mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-11 21:20:09 +00:00
gdk: Don't fully destroy the implicit touch grab on ::grab-broken
the backing GdkTouchGrabInfo will be needed if the overriding device grab finishes before the touch does in order to send events back to the implicit grab window. Instead, wait until the touch is physically finished before removing the matching GdkTouchGrabInfo
This commit is contained in:
parent
6efe116715
commit
b897ba0cd8
@ -700,24 +700,18 @@ _gdk_display_break_touch_grabs (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow *new_grab_window)
|
||||
{
|
||||
guint i = 0;
|
||||
guint i;
|
||||
|
||||
while (i < display->touch_implicit_grabs->len)
|
||||
for (i = 0; i < display->touch_implicit_grabs->len; i++)
|
||||
{
|
||||
GdkTouchGrabInfo *info;
|
||||
|
||||
info = &g_array_index (display->touch_implicit_grabs,
|
||||
GdkTouchGrabInfo, i);
|
||||
|
||||
if (info->device == device &&
|
||||
info->window != new_grab_window)
|
||||
{
|
||||
generate_grab_broken_event (GDK_WINDOW (info->window),
|
||||
device, TRUE, new_grab_window);
|
||||
g_array_remove_index_fast (display->touch_implicit_grabs, i);
|
||||
}
|
||||
else
|
||||
i++;
|
||||
if (info->device == device && info->window != new_grab_window)
|
||||
generate_grab_broken_event (GDK_WINDOW (info->window),
|
||||
device, TRUE, new_grab_window);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9252,9 +9252,9 @@ proxy_pointer_event (GdkDisplay *display,
|
||||
|
||||
if (pointer_info->need_touch_press_enter &&
|
||||
gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCHSCREEN &&
|
||||
gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCHPAD) &&
|
||||
gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCHPAD &&
|
||||
(source_event->type != GDK_TOUCH_UPDATE ||
|
||||
_gdk_event_get_pointer_emulated (source_event))
|
||||
_gdk_event_get_pointer_emulated (source_event)))
|
||||
{
|
||||
pointer_info->need_touch_press_enter = FALSE;
|
||||
need_synthetic_enter = TRUE;
|
||||
@ -9687,7 +9687,8 @@ proxy_button_event (GdkEvent *source_event,
|
||||
if ((type == GDK_TOUCH_END &&
|
||||
_gdk_event_get_pointer_emulated (source_event)) &&
|
||||
pointer_window == pointer_info->window_under_pointer &&
|
||||
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
|
||||
(gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
|
||||
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD))
|
||||
{
|
||||
/* Synthesize a leave notify event
|
||||
* whenever a touch device is released
|
||||
|
Loading…
Reference in New Issue
Block a user