]> Pileus Git - ~andy/gtk/commitdiff
gdk: strengthen touch crossing event synthesizing on programmatical crossings
authorCarlos Garnacho <carlos@lanedo.com>
Mon, 3 Dec 2012 17:28:57 +0000 (18:28 +0100)
committerCarlos Garnacho <carlos@lanedo.com>
Tue, 15 Jan 2013 16:48:56 +0000 (17:48 +0100)
There are cases where crossing events aren't generated by input devices themselves
but rather through programmatical means (windows being moved/hidden/destroyed while
the pointer is on top).

Those events come from X as sourceid=deviceid, and GDK does its deal at lessening
this by setting a meaningful source device on such events, although this caused
some confusion on the mechanism to block/synthesize touch crossing events that
could possibly cause bogus enter events on the new window below the pointer.

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

gdk/gdkdisplay.c
gdk/gdkwindow.c

index 60bbb44c8f07dceda39e0c3627c2a12b755ec5ae..b02ab8a541fa2bb691bdbd3d68c600227c8b3ffe 100644 (file)
@@ -985,7 +985,8 @@ switch_to_pointer_grab (GdkDisplay        *display,
                                                 NULL, NULL);
             }
 
-         if (pointer_window != last_grab->window)
+         if (!info->need_touch_press_enter &&
+             pointer_window != last_grab->window)
             synthesize_crossing_events (display, device, source_device,
                                         last_grab->window, pointer_window,
                                         GDK_CROSSING_UNGRAB, time, serial);
index 065dfcd9fc057d0139ab39b2c1ba82e1db298cda..e337d53ae1943b3381734f22660cc7da7f41ff34 100644 (file)
@@ -8373,10 +8373,12 @@ send_crossing_event (GdkDisplay                 *display,
     window_event_mask = window->event_mask;
 
   if (type == GDK_ENTER_NOTIFY &&
-      pointer_info->need_touch_press_enter &&
+      (pointer_info->need_touch_press_enter ||
+       gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN) &&
       mode != GDK_CROSSING_TOUCH_BEGIN &&
       mode != GDK_CROSSING_TOUCH_END)
     {
+      pointer_info->need_touch_press_enter = TRUE;
       block_event = TRUE;
     }
   else if (type == GDK_LEAVE_NOTIFY)