diff options
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r-- | sway/commands/move.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index a1c1e018..6ec050a8 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <wlr/types/wlr_output_layout.h> | 6 | #include <wlr/types/wlr_output_layout.h> |
7 | #include <wlr/util/log.h> | 7 | #include <wlr/util/log.h> |
8 | #include "sway/commands.h" | 8 | #include "sway/commands.h" |
9 | #include "sway/desktop/transaction.h" | ||
10 | #include "sway/input/cursor.h" | 9 | #include "sway/input/cursor.h" |
11 | #include "sway/input/seat.h" | 10 | #include "sway/input/seat.h" |
12 | #include "sway/output.h" | 11 | #include "sway/output.h" |
@@ -105,10 +104,8 @@ static struct cmd_results *cmd_move_container(struct sway_container *current, | |||
105 | // TODO: Ideally we would arrange the surviving parent after reaping, | 104 | // TODO: Ideally we would arrange the surviving parent after reaping, |
106 | // but container_reap_empty does not return it, so we arrange the | 105 | // but container_reap_empty does not return it, so we arrange the |
107 | // workspace instead. | 106 | // workspace instead. |
108 | struct sway_transaction *txn = transaction_create(); | 107 | arrange_windows(old_ws); |
109 | arrange_windows(old_ws, txn); | 108 | arrange_windows(destination->parent); |
110 | arrange_windows(destination->parent, txn); | ||
111 | transaction_commit(txn); | ||
112 | 109 | ||
113 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 110 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
114 | } else if (strcasecmp(argv[1], "to") == 0 | 111 | } else if (strcasecmp(argv[1], "to") == 0 |
@@ -144,10 +141,8 @@ static struct cmd_results *cmd_move_container(struct sway_container *current, | |||
144 | // TODO: Ideally we would arrange the surviving parent after reaping, | 141 | // TODO: Ideally we would arrange the surviving parent after reaping, |
145 | // but container_reap_empty does not return it, so we arrange the | 142 | // but container_reap_empty does not return it, so we arrange the |
146 | // workspace instead. | 143 | // workspace instead. |
147 | struct sway_transaction *txn = transaction_create(); | 144 | arrange_windows(old_ws); |
148 | arrange_windows(old_ws, txn); | 145 | arrange_windows(focus->parent); |
149 | arrange_windows(focus->parent, txn); | ||
150 | transaction_commit(txn); | ||
151 | 146 | ||
152 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 147 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
153 | } | 148 | } |
@@ -177,10 +172,8 @@ static struct cmd_results *cmd_move_workspace(struct sway_container *current, | |||
177 | } | 172 | } |
178 | container_move_to(current, destination); | 173 | container_move_to(current, destination); |
179 | 174 | ||
180 | struct sway_transaction *txn = transaction_create(); | 175 | arrange_windows(source); |
181 | arrange_windows(source, txn); | 176 | arrange_windows(destination); |
182 | arrange_windows(destination, txn); | ||
183 | transaction_commit(txn); | ||
184 | 177 | ||
185 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 178 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
186 | } | 179 | } |
@@ -238,12 +231,10 @@ static struct cmd_results *move_in_direction(struct sway_container *container, | |||
238 | container_move(container, direction, move_amt); | 231 | container_move(container, direction, move_amt); |
239 | struct sway_container *new_ws = container_parent(container, C_WORKSPACE); | 232 | struct sway_container *new_ws = container_parent(container, C_WORKSPACE); |
240 | 233 | ||
241 | struct sway_transaction *txn = transaction_create(); | 234 | arrange_windows(old_ws); |
242 | arrange_windows(old_ws, txn); | ||
243 | if (new_ws != old_ws) { | 235 | if (new_ws != old_ws) { |
244 | arrange_windows(new_ws, txn); | 236 | arrange_windows(new_ws); |
245 | } | 237 | } |
246 | transaction_commit(txn); | ||
247 | 238 | ||
248 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 239 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
249 | } | 240 | } |