diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2015-12-09 12:49:43 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2015-12-15 00:40:21 +0100 |
commit | 3009eac85e15607bfda70952a13c33e36219ba38 (patch) | |
tree | b29a852a651cc9ce43ba95929d2348b85ade822e | |
parent | 77cf80f3a9e788a93519b3cde44c5106ddc760ae (diff) | |
download | gtk+-3009eac85e15607bfda70952a13c33e36219ba38.tar.gz |
wayland: Emit cancelled on touchpoint used on window dragging/moving
This allows GDK to unset the grab itself. Also, make sure we unset
the "pointer emulating" touch on the device if this is the
pointer emulating sequence.
https://bugzilla.gnome.org/show_bug.cgi?id=759309
-rw-r--r-- | gdk/wayland/gdkdevice-wayland.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index e6eaf624a6..3836d6ef6a 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -2819,14 +2819,27 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device, GdkEventSequence *sequence) { GdkWaylandDeviceData *device; + GdkWaylandTouchData *touch; + GdkEvent *event; g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device)); device = GDK_WAYLAND_DEVICE (gdk_device)->device; + touch = gdk_wayland_device_get_touch (device, + GDK_EVENT_SEQUENCE_TO_SLOT (sequence)); - gdk_wayland_device_remove_touch (device, GDK_EVENT_SEQUENCE_TO_SLOT (sequence)); - _gdk_display_end_touch_grab (gdk_device_get_display (gdk_device), - gdk_device, sequence); + if (GDK_WAYLAND_DEVICE (device->touch_master)->emulating_touch == touch) + { + GDK_WAYLAND_DEVICE (device->touch_master)->emulating_touch = NULL; + emulate_touch_crossing (touch->window, NULL, + device->touch_master, device->touch, + touch, GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL, + GDK_CURRENT_TIME); + } + + event = _create_touch_event (device, touch, GDK_TOUCH_CANCEL, + GDK_CURRENT_TIME); + _gdk_wayland_display_deliver_event (device->display, event); } struct wl_data_device * |