mirror of
https://github.com/swaywm/sway.git
synced 2024-11-21 15:31:28 +00:00
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.
This commit is contained in:
parent
9bfb38521a
commit
3ede5983b9
|
@ -605,9 +605,6 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
|
||||||
|
|
||||||
// Handle existing seat operation
|
// Handle existing seat operation
|
||||||
if (seat_doing_seatop(seat)) {
|
if (seat_doing_seatop(seat)) {
|
||||||
if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) {
|
|
||||||
seatop_finish(seat, time_msec);
|
|
||||||
}
|
|
||||||
if (state == WLR_BUTTON_PRESSED) {
|
if (state == WLR_BUTTON_PRESSED) {
|
||||||
state_add_button(cursor, button);
|
state_add_button(cursor, button);
|
||||||
} else {
|
} else {
|
||||||
|
@ -616,6 +613,9 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
|
||||||
if (seatop_allows_events(seat)) {
|
if (seatop_allows_events(seat)) {
|
||||||
seat_pointer_notify_button(seat, time_msec, button, state);
|
seat_pointer_notify_button(seat, time_msec, button, state);
|
||||||
}
|
}
|
||||||
|
if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) {
|
||||||
|
seatop_finish(seat, time_msec);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue