diff options
Diffstat (limited to 'sway/commands/swap.c')
-rw-r--r-- | sway/commands/swap.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/commands/swap.c b/sway/commands/swap.c index e8dfc57f..e052058f 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c | |||
@@ -1,6 +1,8 @@ | |||
1 | #include <strings.h> | 1 | #include <strings.h> |
2 | #include <wlr/util/log.h> | 2 | #include <wlr/util/log.h> |
3 | #include "sway/commands.h" | 3 | #include "sway/commands.h" |
4 | #include "sway/desktop/transaction.h" | ||
5 | #include "sway/tree/arrange.h" | ||
4 | #include "sway/tree/layout.h" | 6 | #include "sway/tree/layout.h" |
5 | #include "sway/tree/view.h" | 7 | #include "sway/tree/view.h" |
6 | #include "stringop.h" | 8 | #include "stringop.h" |
@@ -76,5 +78,15 @@ struct cmd_results *cmd_swap(int argc, char **argv) { | |||
76 | } | 78 | } |
77 | 79 | ||
78 | container_swap(current, other); | 80 | container_swap(current, other); |
81 | |||
82 | struct sway_transaction *txn = transaction_create(); | ||
83 | arrange_windows(current->parent, txn); | ||
84 | |||
85 | if (other->parent != current->parent) { | ||
86 | arrange_windows(other->parent, txn); | ||
87 | } | ||
88 | |||
89 | transaction_commit(txn); | ||
90 | |||
79 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 91 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
80 | } | 92 | } |