summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlos@lanedo.com>2012-12-03 18:28:57 +0100
committerCarlos Garnacho <carlos@lanedo.com>2013-01-15 17:53:20 +0100
commit63998cc93f6d8c10551b20f458b800471d6daf03 (patch)
tree5b9380317081d1358babe511d76f23cd22041074
parentef05d241e22109362e748617b9bb4b34a81f60e0 (diff)
downloadgtk+-63998cc93f6d8c10551b20f458b800471d6daf03.tar.gz
gdk: strengthen touch crossing event synthesizing on programmatical crossings
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
-rw-r--r--gdk/gdkdisplay.c3
-rw-r--r--gdk/gdkwindow.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 60bbb44c8f..b02ab8a541 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -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);
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 206edc3b69..2aa52fb738 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -8367,10 +8367,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)