summaryrefslogtreecommitdiff
path: root/gdk/gdkdisplay.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2011-12-03 15:11:08 +0100
committerMatthias Clasen <mclasen@redhat.com>2012-03-01 16:25:21 -0500
commit8689921b90556008da9ba34326346fd6856c9d47 (patch)
tree933b88a082a1cb9d50f5733b6f137014e9841844 /gdk/gdkdisplay.c
parent9f4bfff1b030fffa0d815557ec690d208cb4cd67 (diff)
downloadgtk+-8689921b90556008da9ba34326346fd6856c9d47.tar.gz
gdk: Generate crossing events around touch devices' press/release
Anytime a touch device interacts, the crossing events generation will change to a touch mode where only events with mode GDK_CROSSING_TOUCH_BEGIN/END are handled, and those are sent around touch begin/end. Those are virtual as the master device may still stay on the window. Whenever there is a switch of slave device (the user starts using another non-touch device), a crossing event with mode GDK_CROSSING_DEVICE_SWITCH may generated if needed, and the normal crossing event handling is resumed.
Diffstat (limited to 'gdk/gdkdisplay.c')
-rw-r--r--gdk/gdkdisplay.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index b177f2afc9..bb4be5f6b2 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -895,15 +895,26 @@ switch_to_pointer_grab (GdkDisplay *display,
if (grab == NULL) /* Ungrabbed, send events */
{
- pointer_window = NULL;
- if (new_toplevel)
- {
- /* Find (possibly virtual) child window */
- pointer_window =
- _gdk_window_find_descendant_at (new_toplevel,
- x, y,
- NULL, NULL);
- }
+ /* If the source device is a touch device, do not
+ * propagate any enter event yet, until one is
+ * synthesized when needed.
+ */
+ if (source_device &&
+ (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
+ gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD))
+ info->need_touch_press_enter = TRUE;
+
+ pointer_window = NULL;
+
+ if (new_toplevel &&
+ !info->need_touch_press_enter)
+ {
+ /* Find (possibly virtual) child window */
+ pointer_window =
+ _gdk_window_find_descendant_at (new_toplevel,
+ x, y,
+ NULL, NULL);
+ }
if (pointer_window != last_grab->window)
synthesize_crossing_events (display, device, source_device,