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:
Stanislav Brabec 2010-07-22 16:19:49 -05:00 committed by Federico Mena Quintero
parent c1a2ecc369
commit ccc3d2c69f

View File

@ -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);