aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/swap.c')
-rw-r--r--sway/commands/swap.c12
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 @@
#include <strings.h>
#include <wlr/util/log.h>
#include "sway/commands.h"
+#include "sway/desktop/transaction.h"
+#include "sway/tree/arrange.h"
#include "sway/tree/layout.h"
#include "sway/tree/view.h"
#include "stringop.h"
@@ -76,5 +78,15 @@ struct cmd_results *cmd_swap(int argc, char **argv) {
}
container_swap(current, other);
+
+ struct sway_transaction *txn = transaction_create();
+ arrange_windows(current->parent, txn);
+
+ if (other->parent != current->parent) {
+ arrange_windows(other->parent, txn);
+ }
+
+ transaction_commit(txn);
+
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}