aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2019-02-28 19:22:47 +0100
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-03-04 12:50:47 -0500
commitacb23fe89199c3c7a86f2bc94904114f2fbab4a7 (patch)
tree215c1173962ae6ae179b5fc9d2268af9c112f22c /sway/input/cursor.c
parenttray: fix pixmap colors (diff)
downloadsway-acb23fe89199c3c7a86f2bc94904114f2fbab4a7.tar.gz
sway-acb23fe89199c3c7a86f2bc94904114f2fbab4a7.tar.zst
sway-acb23fe89199c3c7a86f2bc94904114f2fbab4a7.zip
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.
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 87811550..44b5ff14 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -606,8 +606,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
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) { 608 if (button == seat->seatop_button && state == WLR_BUTTON_RELEASED) {
609 seatop_finish(seat); 609 seatop_finish(seat, time_msec);
610 seat_pointer_notify_button(seat, time_msec, button, state);
611 } 610 }
612 if (state == WLR_BUTTON_PRESSED) { 611 if (state == WLR_BUTTON_PRESSED) {
613 state_add_button(cursor, button); 612 state_add_button(cursor, button);
@@ -784,8 +783,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
784 // Handle mousedown on a container surface 783 // Handle mousedown on a container surface
785 if (surface && cont && state == WLR_BUTTON_PRESSED) { 784 if (surface && cont && state == WLR_BUTTON_PRESSED) {
786 seat_set_focus_container(seat, cont); 785 seat_set_focus_container(seat, cont);
787 seat_pointer_notify_button(seat, time_msec, button, state); 786 seatop_begin_down(seat, cont, time_msec, button, sx, sy);
788 seatop_begin_down(seat, cont, button, sx, sy);
789 return; 787 return;
790 } 788 }
791 789