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

Index: gtk+-2.20.1/gtk/gtkdnd.c
===================================================================
--- gtk+-2.20.1.orig/gtk/gtkdnd.c
+++ gtk+-2.20.1/gtk/gtkdnd.c
@@ -2390,7 +2390,11 @@ gtk_drag_begin_internal (GtkWidget
 				NULL);
   
   if (event)
-    time = gdk_event_get_time (event);
+    {
+      time = gdk_event_get_time (event);
+      if (time == GDK_CURRENT_TIME)
+        time = gtk_get_current_event_time ();
+    }
 
   if (gdk_pointer_grab (ipc_widget->window, FALSE,
 			GDK_POINTER_MOTION_MASK |
@@ -4111,6 +4115,10 @@ gtk_drag_end (GtkDragSourceInfo *info, g
   GtkWidget *source_widget = info->widget;
   GdkDisplay *display = gtk_widget_get_display (source_widget);
 
+  /* 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);
