From f0f0d02bf74b1ba4279b25883db7b48619242377 Mon Sep 17 00:00:00 2001 From: CismonX Date: Sat, 19 Aug 2023 23:01:53 +0800 Subject: input: improve touch handling on pointer presense No longer inhibits touch event handling when terminal window has pointer focus. Instead, inhibit touch event when at least one pointer button is held down. This change improves user experience when using foot with both a mouse and a touchscreen. Closes #1428. --- wayland.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index d558c489..7fcb01c1 100644 --- a/wayland.c +++ b/wayland.c @@ -345,6 +345,12 @@ seat_handle_capabilities(void *data, struct wl_seat *wl_seat, if (seat->pointer.theme != NULL) wl_cursor_theme_destroy(seat->pointer.theme); + if (seat->wl_touch != NULL && + seat->touch.state == TOUCH_STATE_INHIBITED) + { + seat->touch.state = TOUCH_STATE_IDLE; + } + seat->wl_pointer = NULL; seat->pointer.surface.surf = NULL; seat->pointer.theme = NULL; -- cgit v1.3