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.
This commit is contained in:
CismonX 2023-08-19 23:01:53 +08:00
parent 4f3f614457
commit f0f0d02bf7
No known key found for this signature in database
GPG key ID: 3094873E29A482FB
3 changed files with 73 additions and 32 deletions

View file

@ -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;