commit c12f3934b20e100b7309266f5a3ae82ada98fb2d
Author: Stanislav Brabec <sbrabec@suse.cz>
Date:   Tue Jul 20 19:12:50 2010 +0200

    Fix time disparity pointer grab dead lock: If gtk_drag_begin() uses
    GDK_CURRENT_TIME, try to get gtk_get_current_event_time(). If it fails,
    use GDK_CURRENT_TIME in gtk_drag_end().
    
    For more see https://bugzilla.gnome.org/show_bug.cgi?id=623865

diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 2322ec4..52d8eda 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -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);
