summaryrefslogtreecommitdiffstats
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index a0764a54..1f82e534 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -217,7 +217,9 @@ void container_move_to(struct sway_container *container,
217 container_sort_workspaces(new_parent); 217 container_sort_workspaces(new_parent);
218 seat_set_focus(seat, new_parent); 218 seat_set_focus(seat, new_parent);
219 workspace_output_raise_priority(container, old_parent, new_parent); 219 workspace_output_raise_priority(container, old_parent, new_parent);
220 ipc_event_workspace(container, NULL, "move"); 220 ipc_event_workspace(NULL, container, "move");
221 } else if (container->type == C_VIEW) {
222 ipc_event_window(container, "move");
221 } 223 }
222 container_notify_subtree_changed(old_parent); 224 container_notify_subtree_changed(old_parent);
223 container_notify_subtree_changed(new_parent); 225 container_notify_subtree_changed(new_parent);
@@ -578,6 +580,10 @@ void container_move(struct sway_container *container,
578 container_notify_subtree_changed(old_parent); 580 container_notify_subtree_changed(old_parent);
579 container_notify_subtree_changed(container->parent); 581 container_notify_subtree_changed(container->parent);
580 582
583 if (container->type == C_VIEW) {
584 ipc_event_window(container, "move");
585 }
586
581 if (old_parent) { 587 if (old_parent) {
582 seat_set_focus(config->handler_context.seat, old_parent); 588 seat_set_focus(config->handler_context.seat, old_parent);
583 seat_set_focus(config->handler_context.seat, container); 589 seat_set_focus(config->handler_context.seat, container);
@@ -592,7 +598,7 @@ void container_move(struct sway_container *container,
592 next_ws = container_parent(next_ws, C_WORKSPACE); 598 next_ws = container_parent(next_ws, C_WORKSPACE);
593 } 599 }
594 if (last_ws && next_ws && last_ws != next_ws) { 600 if (last_ws && next_ws && last_ws != next_ws) {
595 ipc_event_workspace(last_ws, container, "focus"); 601 ipc_event_workspace(last_ws, next_ws, "focus");
596 workspace_detect_urgent(last_ws); 602 workspace_detect_urgent(last_ws);
597 workspace_detect_urgent(next_ws); 603 workspace_detect_urgent(next_ws);
598 } 604 }
@@ -995,13 +1001,13 @@ static void swap_focus(struct sway_container *con1,
995 if (focus == con1 && (con2->parent->layout == L_TABBED 1001 if (focus == con1 && (con2->parent->layout == L_TABBED
996 || con2->parent->layout == L_STACKED)) { 1002 || con2->parent->layout == L_STACKED)) {
997 if (workspace_is_visible(ws2)) { 1003 if (workspace_is_visible(ws2)) {
998 seat_set_focus_warp(seat, con2, false); 1004 seat_set_focus_warp(seat, con2, false, true);
999 } 1005 }
1000 seat_set_focus(seat, ws1 != ws2 ? con2 : con1); 1006 seat_set_focus(seat, ws1 != ws2 ? con2 : con1);
1001 } else if (focus == con2 && (con1->parent->layout == L_TABBED 1007 } else if (focus == con2 && (con1->parent->layout == L_TABBED
1002 || con1->parent->layout == L_STACKED)) { 1008 || con1->parent->layout == L_STACKED)) {
1003 if (workspace_is_visible(ws1)) { 1009 if (workspace_is_visible(ws1)) {
1004 seat_set_focus_warp(seat, con1, false); 1010 seat_set_focus_warp(seat, con1, false, true);
1005 } 1011 }
1006 seat_set_focus(seat, ws1 != ws2 ? con1 : con2); 1012 seat_set_focus(seat, ws1 != ws2 ? con1 : con2);
1007 } else if (ws1 != ws2) { 1013 } else if (ws1 != ws2) {