mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
Fix stuck pointer grab due to passing GDK_CURRENT_TIME to gtk_drag_begin()
If gtk_drag_begin() gets passed GDK_CURRENT_TIME, try to use gtk_get_current_event_time(). If it fails, use GDK_CURRENT_TIME when ungrabbing in gtk_drag_end(). For more see https://bugzilla.gnome.org/show_bug.cgi?id=623865
This commit is contained in:
parent
c1a2ecc369
commit
ccc3d2c69f
@ -2362,6 +2362,9 @@ gtk_drag_begin_internal (GtkWidget *widget,
|
||||
if (event)
|
||||
{
|
||||
time = gdk_event_get_time (event);
|
||||
if (time == GDK_CURRENT_TIME)
|
||||
time = gtk_get_current_event_time ();
|
||||
|
||||
pointer = gdk_event_get_device (event);
|
||||
|
||||
if (pointer->source == GDK_SOURCE_KEYBOARD)
|
||||
@ -4064,6 +4067,10 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
|
||||
pointer = gdk_drag_context_get_device (info->context);
|
||||
keyboard = gdk_device_get_associated_device (pointer);
|
||||
|
||||
/* Prevent ungrab before grab (see bug 623865) */
|
||||
if (info->grab_time == GDK_CURRENT_TIME)
|
||||
time = GDK_CURRENT_TIME;
|
||||
|
||||
if (info->update_idle)
|
||||
{
|
||||
g_source_remove (info->update_idle);
|
||||
|
Loading…
Reference in New Issue
Block a user