aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-07-18 21:55:14 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-08-01 16:57:15 +0100
commit03eaf444a4a432e5712d40f93d849b51d2028b63 (patch)
treeab593f6a5157668ed8515c0af211b7b8c1d37b1c /sway/tree/layout.c
parentipc: fix workspace::focus event behaviour (diff)
downloadsway-03eaf444a4a432e5712d40f93d849b51d2028b63.tar.gz
sway-03eaf444a4a432e5712d40f93d849b51d2028b63.tar.zst
sway-03eaf444a4a432e5712d40f93d849b51d2028b63.zip
ipc: prevent emitting a workspace::focus event when moving a container to a different workspace or output
When a container is moved from, say, workspace 1 to workspace 2, workspace 2 is focused in order to arrange the windows before focus is moved back to workspace 1, which caused a workspace:focus event from workspace 2 to workspace 1 to be emitted. This commit inhibits that event.
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 9fbbccaf..1f82e534 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -1001,13 +1001,13 @@ static void swap_focus(struct sway_container *con1,
1001 if (focus == con1 && (con2->parent->layout == L_TABBED 1001 if (focus == con1 && (con2->parent->layout == L_TABBED
1002 || con2->parent->layout == L_STACKED)) { 1002 || con2->parent->layout == L_STACKED)) {
1003 if (workspace_is_visible(ws2)) { 1003 if (workspace_is_visible(ws2)) {
1004 seat_set_focus_warp(seat, con2, false); 1004 seat_set_focus_warp(seat, con2, false, true);
1005 } 1005 }
1006 seat_set_focus(seat, ws1 != ws2 ? con2 : con1); 1006 seat_set_focus(seat, ws1 != ws2 ? con2 : con1);
1007 } else if (focus == con2 && (con1->parent->layout == L_TABBED 1007 } else if (focus == con2 && (con1->parent->layout == L_TABBED
1008 || con1->parent->layout == L_STACKED)) { 1008 || con1->parent->layout == L_STACKED)) {
1009 if (workspace_is_visible(ws1)) { 1009 if (workspace_is_visible(ws1)) {
1010 seat_set_focus_warp(seat, con1, false); 1010 seat_set_focus_warp(seat, con1, false, true);
1011 } 1011 }
1012 seat_set_focus(seat, ws1 != ws2 ? con1 : con2); 1012 seat_set_focus(seat, ws1 != ws2 ? con1 : con2);
1013 } else if (ws1 != ws2) { 1013 } else if (ws1 != ws2) {