aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/swap.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-06-30 06:27:39 -0700
committerGitHub <noreply@github.com>2018-06-30 06:27:39 -0700
commitd8c61c976372eedf271f505ffd82c461b6503f6f (patch)
tree323739dc80680dd774acfdcf43eb76cfe93aa64c /sway/commands/swap.c
parent9ba72433b6c87086f2772405e09e8ac8c0136a01 (diff)
parente396af853b01438f7e5ef34bfa6fd2507d11ce5a (diff)
Merge pull request #2072 from RyanDwyer/atomic
Atomic layout updates
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);
}