aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Luminarys <kizunanohikari@gmail.com>2015-08-21 09:24:26 -0500
committerLibravatar Luminarys <kizunanohikari@gmail.com>2015-08-21 09:24:26 -0500
commitde86c5f4ea20d005a1f5512406725fb44827e339 (patch)
tree5645390197992ea9f6feeea9d73d12dc2fe9708f /sway
parentFix clang warnings (diff)
downloadsway-de86c5f4ea20d005a1f5512406725fb44827e339.tar.gz
sway-de86c5f4ea20d005a1f5512406725fb44827e339.tar.zst
sway-de86c5f4ea20d005a1f5512406725fb44827e339.zip
Cleanup and minor fixes
Diffstat (limited to 'sway')
-rw-r--r--sway/handlers.c12
-rw-r--r--sway/input_state.c2
-rw-r--r--sway/type113
3 files changed, 7 insertions, 120 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 53eae439..78f8927d 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -419,11 +419,11 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
419 } 419 }
420 } 420 }
421 } 421 }
422 } 422 }
423 } else if (pointer_state.tiling.resize && view) { 423 } else if (pointer_state.tiling.resize && view) {
424 if (view != pointer_state.tiling.init_view) { 424 if (view != pointer_state.tiling.init_view) {
425 // Quit out of the resize 425 // Quit out of the resize
426 pointer_state.tiling.init_view = NULL; 426 //pointer_state.tiling.init_view = NULL;
427 } 427 }
428 if (!view->is_floating && view == pointer_state.tiling.init_view) { 428 if (!view->is_floating && view == pointer_state.tiling.init_view) {
429 // Handle layout resizes -- Find the biggest parent container then apply resizes to that 429 // Handle layout resizes -- Find the biggest parent container then apply resizes to that
@@ -431,7 +431,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
431 swayc_t *parent = view; 431 swayc_t *parent = view;
432 double dx = mouse_origin.x - prev_pos.x; 432 double dx = mouse_origin.x - prev_pos.x;
433 double dy = mouse_origin.y - prev_pos.y; 433 double dy = mouse_origin.y - prev_pos.y;
434 if (pointer_state.lock.top) { 434 if (!pointer_state.lock.bottom) {
435 while (parent->type != C_WORKSPACE) { 435 while (parent->type != C_WORKSPACE) {
436 // TODO: Absolute value is a bad hack here to compensate for rounding. Find a better 436 // TODO: Absolute value is a bad hack here to compensate for rounding. Find a better
437 // way of doing this. 437 // way of doing this.
@@ -453,7 +453,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
453 } 453 }
454 } 454 }
455 } 455 }
456 } else { 456 } else if (!pointer_state.lock.top) {
457 while (parent->type != C_WORKSPACE) { 457 while (parent->type != C_WORKSPACE) {
458 if (fabs(parent->parent->y - view->y) <= 1) { 458 if (fabs(parent->parent->y - view->y) <= 1) {
459 parent = parent->parent; 459 parent = parent->parent;
@@ -476,7 +476,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
476 } 476 }
477 477
478 parent = view; 478 parent = view;
479 if (pointer_state.lock.left) { 479 if (!pointer_state.lock.right) {
480 while (parent->type != C_WORKSPACE) { 480 while (parent->type != C_WORKSPACE) {
481 if (fabs(parent->parent->x + parent->parent->width - (view->x + view->width)) <= 1) { 481 if (fabs(parent->parent->x + parent->parent->width - (view->x + view->width)) <= 1) {
482 parent = parent->parent; 482 parent = parent->parent;
@@ -497,7 +497,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
497 } 497 }
498 } 498 }
499 } 499 }
500 } else { 500 } else if (!pointer_state.lock.left) {
501 while (parent->type != C_WORKSPACE) { 501 while (parent->type != C_WORKSPACE) {
502 if (fabs(parent->parent->x - view->x) <= 1 && parent->parent) { 502 if (fabs(parent->parent->x - view->x) <= 1 && parent->parent) {
503 parent = parent->parent; 503 parent = parent->parent;
diff --git a/sway/input_state.c b/sway/input_state.c
index ef5d6df0..28a8b2f0 100644
--- a/sway/input_state.c
+++ b/sway/input_state.c
@@ -48,7 +48,7 @@ void release_key(keycode key) {
48 } 48 }
49} 49}
50 50
51struct pointer_state pointer_state = {0, 0, {0, 0}, {0}, {0, 0, 0, 0}}; 51struct pointer_state pointer_state = {0, 0, {0, 0}, {0, 0}, {0, 0, 0, 0}};
52 52
53static struct wlc_geometry saved_floating; 53static struct wlc_geometry saved_floating;
54 54
diff --git a/sway/type b/sway/type
deleted file mode 100644
index c7bebe5e..00000000
--- a/sway/type
+++ /dev/null
@@ -1,113 +0,0 @@
1workspace.c:78:9: while (parent->type != C_OUTPUT) {
2workspace.c:79:12: parent = parent->parent;
3
4focus.c:16:6: if (parent->focused != c) {
5focus.c:30:8: if (parent->focused) {
6focus.c:31:19: swayc_t *ws = parent->focused;
7focus.c:38:25: wlc_output_set_mask(parent->handle, 2);
8focus.c:39:8: c->parent->focused = c;
9focus.c:53:5: c->parent->focused = c;
10focus.c:71:20: while (parent && !parent->is_focused) {
11focus.c:72:12: parent = parent->focused;
12focus.c:143:13: if (find->parent->focused != find) {
13focus.c:167:19: while (parent && parent->type != C_VIEW) {
14focus.c:168:7: if (parent->type == C_WORKSPACE && parent->focused == NULL) {
15focus.c:171:12: parent = parent->focused;
16
17handlers.c:24:9: while (parent->type != C_OUTPUT) {
18handlers.c:25:12: parent = parent->parent;
19handlers.c:436:18: while (parent->parent && parent->y + parent->height == view->y + view->height && parent->type != L_WORKSPACE) {
20handlers.c:437:30: parent = parent->parent;
21handlers.c:440:50: if (parent == &root_container || parent->children->length == 1) {
22handlers.c:444:18: while (parent->parent && parent->y == view->y) {
23handlers.c:445:30: parent = parent->parent;
24handlers.c:448:50: if (parent == &root_container || parent->children->length == 1) {
25handlers.c:454:18: while (parent->parent && parent->x + parent->width == view->x + view->width) {
26handlers.c:455:30: parent = parent->parent;
27handlers.c:458:50: if (parent == &root_container || parent->children->length == 1) {
28handlers.c:462:18: while (parent->parent && parent->x + parent->width == view->x) {
29handlers.c:463:30: parent = parent->parent;
30handlers.c:466:50: if (parent == &root_container || parent->children->length == 1) {
31handlers.c:528:29: for (i = 0; i < pointer->parent->floating->length; i++) {
32handlers.c:529:18: if (pointer->parent->floating->items[i] == pointer) {
33handlers.c:530:24: list_del(pointer->parent->floating, i);
34handlers.c:531:24: list_add(pointer->parent->floating, pointer);
35
36container.c:284:6: if (parent->type == C_CONTAINER) {
37
38layout.c:23:18: for (i = 0; i < parent->children->length; ++i) {
39layout.c:24:7: if (parent->children->items[i] == child) {
40layout.c:33:40: child->width, child->height, parent, parent->type, parent->width, parent->height);
41layout.c:34:11: list_add(parent->children, child);
42layout.c:37:6: if (parent->children->length == 1) {
43layout.c:56:11: if (i == parent->children->length) {
44layout.c:59:14: list_insert(parent->children, i+1, child);
45layout.c:70:2: parent->children->items[i] = new_child;
46layout.c:73:13: if (child->parent->focused == child) {
47layout.c:85:19: for (i = 0; i < parent->floating->length; ++i) {
48layout.c:86:8: if (parent->floating->items[i] == child) {
49layout.c:87:14: list_del(parent->floating, i);
50layout.c:93:19: for (i = 0; i < parent->children->length; ++i) {
51layout.c:94:8: if (parent->children->items[i] == child) {
52layout.c:95:14: list_del(parent->children, i);
53layout.c:101:6: if (parent->focused == child) {
54layout.c:102:7: if (parent->children->length > 0) {
55layout.c:103:38: set_focused_container_for(parent, parent->children->items[i?i-1:0]);
56layout.c:105:4: parent->focused = NULL;
57layout.c:165:12: while (parent->type != C_OUTPUT) {
58layout.c:166:15: parent = parent->parent;
59layout.c:170:23: geometry.size.w = parent->width;
60layout.c:171:23: geometry.size.h = parent->height;
61layout.c:267:13: while (parent->type != C_OUTPUT) {
62layout.c:268:16: parent = parent->parent;
63layout.c:272:24: geometry.size.w = parent->width;
64layout.c:273:24: geometry.size.h = parent->height;
65layout.c:294:6: if (parent->children == NULL) {
66layout.c:300:6: if (parent->type == C_WORKSPACE) {
67layout.c:301:19: for (i = 0; i < parent->floating->length; ++i) {
68layout.c:302:21: swayc_t *child = parent->floating->items[i];
69layout.c:309:18: for (i = 0; i < parent->children->length; ++i) {
70layout.c:310:20: swayc_t *child = parent->children->items[i];
71layout.c:327:7: if (parent->type == C_OUTPUT) {
72layout.c:338:8: if (parent->layout == L_HORIZ || parent->type == C_ROOT) {
73layout.c:343:8: if (parent->layout == L_VERT) {
74layout.c:350:20: for (i = 0; i < parent->children->length; ++i) {
75layout.c:351:22: swayc_t *child = parent->children->items[i];
76layout.c:357:34: if (desired < 0 || desired >= parent->children->length) {
77layout.c:360:12: return parent->children->items[desired];
78layout.c:365:13: parent = parent->parent;
79
80commands.c:394:9: while (parent->type == C_VIEW) {
81commands.c:395:12: parent = parent->parent;
82commands.c:399:3: parent->layout = L_HORIZ;
83commands.c:401:3: parent->layout = L_VERT;
84commands.c:403:7: if (parent->layout == L_VERT) {
85commands.c:404:4: parent->layout = L_HORIZ;
86commands.c:406:4: parent->layout = L_VERT;
87commands.c:409:26: arrange_windows(parent, parent->width, parent->height);
88commands.c:454:10: while (parent->parent) {
89commands.c:455:8: if (parent->parent->layout == L_HORIZ) {
90commands.c:456:21: for (i = 0; i < parent->parent->children->length; i++) {
91commands.c:457:16: sibling = parent->parent->children->items[i];
92commands.c:459:24: if (sibling->x < parent->x) {
93commands.c:461:31: } else if (sibling->x > parent->x) {
94commands.c:470:13: parent = parent->parent;
95commands.c:475:87: sway_log(L_DEBUG, "Found the proper parent: %p. It has %d l conts, and %d r conts", parent->parent, lnumber, rnumber);
96commands.c:477:19: for (i = 0; i < parent->parent->children->length; i++) {
97commands.c:478:14: sibling = parent->parent->children->items[i];
98commands.c:480:22: if (sibling->x < parent->x) {
99commands.c:488:29: } else if (sibling->x > parent->x) {
100commands.c:517:10: while (parent->parent) {
101commands.c:518:8: if (parent->parent->layout == L_VERT) {
102commands.c:519:21: for (i = 0; i < parent->parent->children->length; i++) {
103commands.c:520:16: sibling = parent->parent->children->items[i];
104commands.c:522:24: if (sibling->y < parent->y) {
105commands.c:524:31: } else if (sibling->y > parent->y) {
106commands.c:533:13: parent = parent->parent;
107commands.c:538:87: sway_log(L_DEBUG, "Found the proper parent: %p. It has %d b conts, and %d t conts", parent->parent, bnumber, tnumber);
108commands.c:540:19: for (i = 0; i < parent->parent->children->length; i++) {
109commands.c:541:14: sibling = parent->parent->children->items[i];
110commands.c:543:22: if (sibling->y < parent->y) {
111commands.c:551:29: } else if (sibling->x > parent->x) {
112commands.c:603:54: } else if (focused->type != C_WORKSPACE && focused->parent->children->length == 1) {
113commands.c:606:12: focused->parent->layout = layout;