diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-07 11:19:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-07 11:19:25 -0400 |
commit | f5a9bd5cb75b37376b98eadbff2facb7e0021d57 (patch) | |
tree | f72219a5a2adec3380da5269fee025715f7bf333 /sway/commands/move.c | |
parent | Merge pull request #1762 from DanySpin97/wlroots (diff) | |
parent | Don't rejigger if parent has two children (diff) | |
download | sway-f5a9bd5cb75b37376b98eadbff2facb7e0021d57.tar.gz sway-f5a9bd5cb75b37376b98eadbff2facb7e0021d57.tar.zst sway-f5a9bd5cb75b37376b98eadbff2facb7e0021d57.zip |
Merge pull request #1700 from swaywm/move-cmd-full
Implement move [left|right|up|down]
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r-- | sway/commands/move.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index c954ab94..15a5ebc4 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -82,6 +82,8 @@ static struct cmd_results *cmd_move_container(struct sway_container *current, | |||
82 | config->handler_context.seat, ws); | 82 | config->handler_context.seat, ws); |
83 | container_move_to(current, focus); | 83 | container_move_to(current, focus); |
84 | seat_set_focus(config->handler_context.seat, old_parent); | 84 | seat_set_focus(config->handler_context.seat, old_parent); |
85 | container_reap_empty(old_parent); | ||
86 | container_reap_empty(focus->parent); | ||
85 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 87 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
86 | } else if (strcasecmp(argv[1], "to") == 0 | 88 | } else if (strcasecmp(argv[1], "to") == 0 |
87 | && strcasecmp(argv[2], "output") == 0) { | 89 | && strcasecmp(argv[2], "output") == 0) { |
@@ -109,6 +111,8 @@ static struct cmd_results *cmd_move_container(struct sway_container *current, | |||
109 | struct sway_container *old_parent = current->parent; | 111 | struct sway_container *old_parent = current->parent; |
110 | container_move_to(current, focus); | 112 | container_move_to(current, focus); |
111 | seat_set_focus(config->handler_context.seat, old_parent); | 113 | seat_set_focus(config->handler_context.seat, old_parent); |
114 | container_reap_empty(old_parent); | ||
115 | container_reap_empty(focus->parent); | ||
112 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 116 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
113 | } | 117 | } |
114 | return cmd_results_new(CMD_INVALID, "move", expected_syntax); | 118 | return cmd_results_new(CMD_INVALID, "move", expected_syntax); |