core: Add minimal handling of touch events

Desktop / GNOME / Mutter - Carlos Garnacho [gnome.org] - 13 March 2014 14:10 UTC

Currently touch events are ignored in the core event handler, and hence dealt with within GDK. If those touch events were emulating pointer events, GDK would attempt to convert back those events to pointer events as the frame GdkWindow doesn't have the GDK_TOUCH_MASK set.

This results in XI_TouchBegin events being initially processed by GDK, converted to button events, and triggering a grab op that subverts touch events into pointer events, so the touch is never ever seen again by GDK. This leaves GDK in an inconsistent internal state wrt pointer grabs, so future pointer-emulating touches will refer to the same window forever.

Fix this by handling touch events minimally, just enough to convert XI_TouchBegin to GDK_BUTTON_PRESS within mutter, so GDK is bypassed for every touch event just like it is for pointer events. This, and the XIGrabDevice() that keeps coercing pointer events when the grab operation starts, are enough to fix window drag and drop on touch devices.

https://bugzilla.gnome.org/show_bug.cgi?id=723552

991c85f core: Add minimal handling of touch events
src/core/display.c | 76 +++++++++++++++++++++++++++++++++++++++++++---------
src/ui/ui.c | 18 ++++++++++---
2 files changed, 78 insertions(+), 16 deletions(-)

Upstream: git.gnome.org


  • Share