aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2019-03-11 18:11:01 +1000
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-03-11 10:57:16 -0400
commit3ede5983b9f39e5f110c5540d136945bc66d2fc0 (patch)
treefda2fd88b1afe184e9658cca260383ed4a9b1e1c
parentDon't send button events to surfaces when dragging or resizing (diff)
downloadsway-v1.0.tar.gz
sway-v1.0.tar.zst
sway-v1.0.zip
Fix click behaviour1.0v1.0
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 ef03c6aa..d531a20e 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -605,9 +605,6 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
605 605
606 // Handle existing seat operation 606 // Handle existing seat operation
607 if (seat_doing_seatop(seat)) { 607 if (seat_doing_seatop(seat)) {
608 if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) {
609 seatop_finish(seat, time_msec);
610 }
611 if (state == WLR_BUTTON_PRESSED) { 608 if (state == WLR_BUTTON_PRESSED) {
612 state_add_button(cursor, button); 609 state_add_button(cursor, button);
613 } else { 610 } else {
@@ -616,6 +613,9 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
616 if (seatop_allows_events(seat)) { 613 if (seatop_allows_events(seat)) {
617 seat_pointer_notify_button(seat, time_msec, button, state); 614 seat_pointer_notify_button(seat, time_msec, button, state);
618 } 615 }
616 if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) {
617 seatop_finish(seat, time_msec);
618 }
619 return; 619 return;
620 } 620 }
621 621