aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seatop_move_tiling.c
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2021-02-08 02:03:01 +0100
committerTudor Brindus <me@tbrindus.ca>2021-02-14 13:19:08 -0500
commitb5b628cb41a4a316456d5ef3014f1a2cbdc5cfc2 (patch)
treef2dca5621c62d4fea0546c8b9eee99a3cc6dfd6c /sway/input/seatop_move_tiling.c
parentb1b104152e52b4957a0d91e808f4446c50b1c22d (diff)
input: Only commit transactions when necessary
There is no need to check for transactions at the end of every user input, as the vast majority of input will not issue transactions. This implementation can also hide where changes are made without an appropriate transaction commit, as a future unrelated input would issue the commit instead. Instead, commit transactions in places where changes are made or are likely to be made.
Diffstat (limited to 'sway/input/seatop_move_tiling.c')
-rw-r--r--sway/input/seatop_move_tiling.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c
index 704e7270..7d9ecd8f 100644
--- a/sway/input/seatop_move_tiling.c
+++ b/sway/input/seatop_move_tiling.c
@@ -3,6 +3,7 @@
#include <wlr/types/wlr_cursor.h>
#include <wlr/util/edges.h>
#include "sway/desktop.h"
+#include "sway/desktop/transaction.h"
#include "sway/input/cursor.h"
#include "sway/input/seat.h"
#include "sway/ipc-server.h"
@@ -214,6 +215,7 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) {
} else {
handle_motion_prethreshold(seat);
}
+ transaction_commit_dirty();
}
static bool is_parallel(enum sway_container_layout layout,
@@ -294,6 +296,7 @@ static void finalize_move(struct sway_seat *seat) {
arrange_workspace(new_ws);
}
+ transaction_commit_dirty();
seatop_begin_default(seat);
}
@@ -348,6 +351,7 @@ void seatop_begin_move_tiling_threshold(struct sway_seat *seat,
seat->seatop_data = e;
container_raise_floating(con);
+ transaction_commit_dirty();
wlr_seat_pointer_notify_clear_focus(seat->wlr_seat);
}