diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2019-03-11 18:11:01 +1000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-11 10:57:16 -0400 |
commit | 3ede5983b9f39e5f110c5540d136945bc66d2fc0 (patch) | |
tree | fda2fd88b1afe184e9658cca260383ed4a9b1e1c | |
parent | 9bfb38521a6016042dffbe7e3242265b8134bda5 (diff) |
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index ef03c6aa4..d531a20e3 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; } |