Skip to content

Commit

Permalink
Fix click behaviour
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RyanDwyer authored and ddevault committed Mar 11, 2019
1 parent 9bfb385 commit 3ede598
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sway/input/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
}

Expand Down

0 comments on commit 3ede598

Please sign in to comment.