diff options
-rw-r--r-- | include/sway/input/cursor.h | 1 | ||||
-rw-r--r-- | sway/input/cursor.c | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index b053b85f..7d66e699 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h | |||
@@ -54,6 +54,7 @@ struct sway_cursor { | |||
54 | struct wl_listener touch_motion; | 54 | struct wl_listener touch_motion; |
55 | struct wl_listener touch_frame; | 55 | struct wl_listener touch_frame; |
56 | bool simulating_pointer_from_touch; | 56 | bool simulating_pointer_from_touch; |
57 | bool pointer_touch_up; | ||
57 | int32_t pointer_touch_id; | 58 | int32_t pointer_touch_id; |
58 | 59 | ||
59 | struct wl_listener tool_axis; | 60 | struct wl_listener tool_axis; |
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 96b5b935..2fe5b202 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -507,7 +507,7 @@ static void handle_touch_up(struct wl_listener *listener, void *data) { | |||
507 | 507 | ||
508 | if (cursor->simulating_pointer_from_touch) { | 508 | if (cursor->simulating_pointer_from_touch) { |
509 | if (cursor->pointer_touch_id == cursor->seat->touch_id) { | 509 | if (cursor->pointer_touch_id == cursor->seat->touch_id) { |
510 | cursor->simulating_pointer_from_touch = false; | 510 | cursor->pointer_touch_up = true; |
511 | dispatch_cursor_button(cursor, event->device, event->time_msec, | 511 | dispatch_cursor_button(cursor, event->device, event->time_msec, |
512 | BTN_LEFT, WLR_BUTTON_RELEASED); | 512 | BTN_LEFT, WLR_BUTTON_RELEASED); |
513 | } | 513 | } |
@@ -565,6 +565,11 @@ static void handle_touch_frame(struct wl_listener *listener, void *data) { | |||
565 | 565 | ||
566 | if (cursor->simulating_pointer_from_touch) { | 566 | if (cursor->simulating_pointer_from_touch) { |
567 | wlr_seat_pointer_notify_frame(wlr_seat); | 567 | wlr_seat_pointer_notify_frame(wlr_seat); |
568 | |||
569 | if (cursor->pointer_touch_up) { | ||
570 | cursor->pointer_touch_up = false; | ||
571 | cursor->simulating_pointer_from_touch = false; | ||
572 | } | ||
568 | } else { | 573 | } else { |
569 | wlr_seat_touch_notify_frame(wlr_seat); | 574 | wlr_seat_touch_notify_frame(wlr_seat); |
570 | } | 575 | } |