aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/transaction.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-06-06 22:57:34 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-06-09 10:11:25 +1000
commitbb66e6d578fdc68fb33d0fde921390d74f20bb31 (patch)
tree99d3763eee97acb870c16a762c0ee40af787c295 /sway/desktop/transaction.c
parentf9e6d703d298dbdee0770fd9e0c64ab2d7ac7deb (diff)
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/desktop/transaction.c')
-rw-r--r--sway/desktop/transaction.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 313e707b..ee9883e2 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -17,6 +17,13 @@
*/
#define TIMEOUT_MS 200
+struct sway_transaction {
+ struct wl_event_source *timer;
+ list_t *instructions; // struct sway_transaction_instruction *
+ list_t *damage; // struct wlr_box *
+ size_t num_waiting;
+};
+
struct sway_transaction_instruction {
struct sway_transaction *transaction;
struct sway_container *container;
@@ -162,16 +169,18 @@ void transaction_commit(struct sway_transaction *transaction) {
for (int i = 0; i < transaction->instructions->length; ++i) {
struct sway_transaction_instruction *instruction =
transaction->instructions->items[i];
- if (instruction->container->type == C_VIEW) {
- struct sway_view *view = instruction->container->sway_view;
- instruction->serial = view_configure(view,
+ struct sway_container *con = instruction->container;
+ if (con->type == C_VIEW &&
+ (con->current.view_width != instruction->state.view_width ||
+ con->current.view_height != instruction->state.view_height)) {
+ instruction->serial = view_configure(con->sway_view,
instruction->state.view_x,
instruction->state.view_y,
instruction->state.view_width,
instruction->state.view_height);
if (instruction->serial) {
- save_view_texture(view);
- list_add(view->instructions, instruction);
+ save_view_texture(con->sway_view);
+ list_add(con->sway_view->instructions, instruction);
++transaction->num_waiting;
}
}