summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2015-12-09 12:46:08 +0100
committerCarlos Garnacho <carlosg@gnome.org>2015-12-15 00:40:21 +0100
commit77cf80f3a9e788a93519b3cde44c5106ddc760ae (patch)
treec2895f0940b1a236194a736e804f3cd0eb1614a2
parentfc19a999ec156f7f746c7928f1828f40a01c5b90 (diff)
downloadgtk+-77cf80f3a9e788a93519b3cde44c5106ddc760ae.tar.gz
wayland: Unset "pointer emulating" touch on wl_touch.cancel
And emit the corresnponding leave event on its master pointer. https://bugzilla.gnome.org/show_bug.cgi?id=759309
-rw-r--r--gdk/wayland/gdkdevice-wayland.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index baf40bfb65..e6eaf624a6 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1768,19 +1768,28 @@ static void
touch_handle_cancel (void *data,
struct wl_touch *wl_touch)
{
- GdkWaylandDeviceData *device = data;
+ GdkWaylandSeat *wayland_seat = data;
GdkWaylandTouchData *touch;
GHashTableIter iter;
GdkEvent *event;
- g_hash_table_iter_init (&iter, device->touches);
+ if (GDK_WAYLAND_DEVICE (wayland_seat->touch_master)->emulating_touch)
+ {
+ touch = GDK_WAYLAND_DEVICE (wayland_seat->touch_master)->emulating_touch;
+ GDK_WAYLAND_DEVICE (wayland_seat->touch_master)->emulating_touch = NULL;
+ emulate_touch_crossing (touch->window, NULL,
+ wayland_seat->touch_master, wayland_seat->touch,
+ touch, GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL,
+ GDK_CURRENT_TIME);
+ }
+
+ g_hash_table_iter_init (&iter, wayland_seat->touches);
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch))
{
- event = _create_touch_event (device, touch, GDK_TOUCH_CANCEL,
+ event = _create_touch_event (wayland_seat, touch, GDK_TOUCH_CANCEL,
GDK_CURRENT_TIME);
- _gdk_wayland_display_deliver_event (device->display, event);
-
+ _gdk_wayland_display_deliver_event (wayland_seat->display, event);
g_hash_table_iter_remove (&iter);
}