diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-06 22:57:34 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-09 10:11:25 +1000 |
commit | bb66e6d578fdc68fb33d0fde921390d74f20bb31 (patch) | |
tree | 99d3763eee97acb870c16a762c0ee40af787c295 /sway/commands/swap.c | |
parent | Make main properties be the pending state (diff) | |
download | sway-bb66e6d578fdc68fb33d0fde921390d74f20bb31.tar.gz sway-bb66e6d578fdc68fb33d0fde921390d74f20bb31.tar.zst sway-bb66e6d578fdc68fb33d0fde921390d74f20bb31.zip |
Refactor everything that needs to arrange windows
* The arrange_foo functions are now replaced with arrange_and_commit, or
with manually created transactions and arrange_windows x2.
* The arrange functions are now only called from the highest level
functions rather than from both high level and low level functions.
* Due to the previous point, view_set_fullscreen_raw and
view_set_fullscreen are both merged into one function again.
* Floating and fullscreen are now working with transactions.
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 | } |