From 2be36c5b26c8e4ad954fb28a7dc799ba75185f6f Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlos@lanedo.com>
Date: Thu, 29 Nov 2012 14:45:35 +0100
Subject: [PATCH] gdk: rely on XIDeviceChangedEvent to update touch crossing
events
This signal is emitted to all clients regardless of the pointer position,
so GDK can prepare to block/synthesize crossing events for touch devices
devices prior to getting the pointer on top.
This helps in those crossing events with sourceid=deviceid (eg both
master) that Xorg generates on non-device generated crossing events,
such as windows underneath the pointer moving or disappearing.
---
gdk/gdkdisplay.c | 12 ++++++++++++
gdk/gdkdisplayprivate.h | 4 ++++
gdk/x11/gdkdevicemanager-xi2.c | 3 +++
3 files changed, 19 insertions(+)
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 60bbb44..3c6c810 100644
a
|
b
|
_gdk_display_pointer_info_foreach (GdkDisplay *display, |
1264 | 1264 | } |
1265 | 1265 | } |
1266 | 1266 | |
| 1267 | void |
| 1268 | _gdk_display_update_touch_state (GdkDisplay *display, |
| 1269 | GdkDevice *device, |
| 1270 | GdkDevice *source) |
| 1271 | { |
| 1272 | GdkPointerWindowInfo *info; |
| 1273 | |
| 1274 | info = _gdk_display_get_pointer_info (display, device); |
| 1275 | info->need_touch_press_enter = |
| 1276 | (gdk_device_get_source (source) == GDK_SOURCE_TOUCHSCREEN); |
| 1277 | } |
| 1278 | |
1267 | 1279 | /** |
1268 | 1280 | * gdk_device_grab_info_libgtk_only: |
1269 | 1281 | * @display: the display for which to get the grab information |
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 6549f21..3d078d6 100644
a
|
b
|
void _gdk_display_create_window_impl (GdkDisplay *display |
310 | 310 | gint attributes_mask); |
311 | 311 | GdkWindow * _gdk_display_create_window (GdkDisplay *display); |
312 | 312 | |
| 313 | void _gdk_display_update_touch_state (GdkDisplay *display, |
| 314 | GdkDevice *device, |
| 315 | GdkDevice *source); |
| 316 | |
313 | 317 | G_END_DECLS |
314 | 318 | |
315 | 319 | #endif /* __GDK_DISPLAY_PRIVATE_H__ */ |
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index cfbfe6f..dbcb551 100644
a
|
b
|
handle_device_changed (GdkX11DeviceManagerXI2 *device_manager, |
774 | 774 | |
775 | 775 | if (source_device) |
776 | 776 | _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device)); |
| 777 | |
| 778 | if (device && source_device) |
| 779 | _gdk_display_update_touch_state (display, device, source_device); |
777 | 780 | } |
778 | 781 | |
779 | 782 | static GdkCrossingMode |