aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Geoff Greer <geoff@greer.fm>2018-05-10 23:44:35 -0700
committerLibravatar Geoff Greer <geoff@greer.fm>2018-05-10 23:44:35 -0700
commit87fa84df131bd30251a789360e73b6fe8162d71f (patch)
tree1291fe91f136f269f7ad4dcefb980a863c3e15f4 /sway
parentMerge pull request #1948 from RyanDwyer/focus-parent-border (diff)
downloadsway-87fa84df131bd30251a789360e73b6fe8162d71f.tar.gz
sway-87fa84df131bd30251a789360e73b6fe8162d71f.tar.zst
sway-87fa84df131bd30251a789360e73b6fe8162d71f.zip
cmd_move_container: Focus a window on the source workspace.
In Sway 0.15, moving a window to another workspace would cause a window on the source workspace to be focused. This restores that behavior, allowing you to quickly move a lot of windows to another workspace.
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/move.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index a5273ba4..890b1a8c 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -90,12 +90,14 @@ static struct cmd_results *cmd_move_container(struct sway_container *current,
90 } 90 }
91 free(ws_name); 91 free(ws_name);
92 struct sway_container *old_parent = current->parent; 92 struct sway_container *old_parent = current->parent;
93 struct sway_container *focus = seat_get_focus_inactive( 93 struct sway_container *destination = seat_get_focus_inactive(
94 config->handler_context.seat, ws); 94 config->handler_context.seat, ws);
95 container_move_to(current, focus); 95 container_move_to(current, destination);
96 seat_set_focus(config->handler_context.seat, old_parent); 96 struct sway_container *focus = seat_get_focus_inactive(
97 config->handler_context.seat, old_parent);
98 seat_set_focus(config->handler_context.seat, focus);
97 container_reap_empty(old_parent); 99 container_reap_empty(old_parent);
98 container_reap_empty(focus->parent); 100 container_reap_empty(destination->parent);
99 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 101 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
100 } else if (strcasecmp(argv[1], "to") == 0 102 } else if (strcasecmp(argv[1], "to") == 0
101 && strcasecmp(argv[2], "output") == 0) { 103 && strcasecmp(argv[2], "output") == 0) {