mirror of
https://github.com/swaywm/sway.git
synced 2025-11-19 06:59:52 -05:00
seat: don't send button release when not pressed
All seat operations except "down" eat the button pressed event and don't send it to clients. Thus, when ending such seat operations we shouldn't send the button released event. This commit moves the logic used to send pressed/released into the "down" operation.
This commit is contained in:
parent
416c6ecb99
commit
88b283c557
8 changed files with 18 additions and 18 deletions
|
|
@ -606,8 +606,7 @@ 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);
|
||||
seat_pointer_notify_button(seat, time_msec, button, state);
|
||||
seatop_finish(seat, time_msec);
|
||||
}
|
||||
if (state == WLR_BUTTON_PRESSED) {
|
||||
state_add_button(cursor, button);
|
||||
|
|
@ -784,8 +783,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
|
|||
// Handle mousedown on a container surface
|
||||
if (surface && cont && state == WLR_BUTTON_PRESSED) {
|
||||
seat_set_focus_container(seat, cont);
|
||||
seat_pointer_notify_button(seat, time_msec, button, state);
|
||||
seatop_begin_down(seat, cont, button, sx, sy);
|
||||
seatop_begin_down(seat, cont, time_msec, button, sx, sy);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue