aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2019-03-11 18:11:01 +1000
committeremersion <contact@emersion.fr>2019-03-11 14:55:54 +0100
commit783b3d6b378db0bdf2a10bfa8a6787bd4b152a5a (patch)
tree39db69f2c7fa9bf601163ba2a17708a47a1560bf
parentd16845d5f0f7ea0316fb9d5e2b7d20b78ca41991 (diff)
downloadsway-783b3d6b378db0bdf2a10bfa8a6787bd4b152a5a.zip
sway-783b3d6b378db0bdf2a10bfa8a6787bd4b152a5a.tar.gz
sway-783b3d6b378db0bdf2a10bfa8a6787bd4b152a5a.tar.bz2
Fix click behaviour
By the time seatop_allows_events was called, seatop_impl was already NULL, causing the function to always return false. This means a press event was sent to clients without a corresponding release event. This patch moves the call to seatop_finish to after the seatop_allows_events check.
-rw-r--r--sway/input/cursor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index ef03c6a..d531a20 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -605,9 +605,6 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
// Handle existing seat operation
if (seat_doing_seatop(seat)) {
- if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) {
- seatop_finish(seat, time_msec);
- }
if (state == WLR_BUTTON_PRESSED) {
state_add_button(cursor, button);
} else {
@@ -616,6 +613,9 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
if (seatop_allows_events(seat)) {
seat_pointer_notify_button(seat, time_msec, button, state);
}
+ if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) {
+ seatop_finish(seat, time_msec);
+ }
return;
}