[gtk+] DND: go back to a timeout for cancel animation



commit aab1610d40976abf50b830b6c6eb1f6cdd04a947
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 14 17:10:25 2014 -0700

    DND: go back to a timeout for cancel animation
    
    Using a tick callback does not really make sense here, since we
    are not drawing in a window, but moving a toplevel around.
    https://bugzilla.gnome.org/show_bug.cgi?id=728183

 gtk/gtkdnd.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 9cf00b6..277b6aa 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -256,9 +256,7 @@ static void gtk_drag_selection_get             (GtkWidget         *widget,
                                                guint32            time,
                                                gpointer           data);
 static void gtk_drag_anim_destroy              (GtkDragAnim       *anim);
-static gboolean gtk_drag_anim_tick             (GtkWidget         *widget,
-                                                GdkFrameClock     *frame_clock,
-                                                gpointer           data);
+static gboolean gtk_drag_anim_timeout          (gpointer           data);
 static void gtk_drag_remove_icon               (GtkDragSourceInfo *info);
 static void gtk_drag_source_info_destroy       (GtkDragSourceInfo *info);
 static void gtk_drag_add_update_idle           (GtkDragSourceInfo *info);
@@ -3807,7 +3805,7 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
           * to respond really late, we still are OK.
           */
          gtk_drag_clear_source_info (info->context);
-         gtk_widget_add_tick_callback (info->widget, gtk_drag_anim_tick, anim, (GDestroyNotify) 
gtk_drag_anim_destroy);
+         gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17, gtk_drag_anim_timeout, anim, (GDestroyNotify) 
gtk_drag_anim_destroy);
        }
     }
 }
@@ -4038,13 +4036,13 @@ gtk_drag_anim_destroy (GtkDragAnim *anim)
 }
 
 static gboolean
-gtk_drag_anim_tick (GtkWidget     *widget,
-                    GdkFrameClock *frame_clock,
-                    gpointer       data)
+gtk_drag_anim_timeout (gpointer data)
 {
   GtkWidget *icon_window;
   GtkDragAnim *anim = data;
   GtkDragSourceInfo *info = anim->info;
+  GtkWidget *widget = info->widget;
+  GdkFrameClock *frame_clock = gtk_widget_get_frame_clock (widget);
   gint64 current_time = gdk_frame_clock_get_frame_time (frame_clock);
   int hot_x, hot_y;
   double f = (current_time - anim->start_time) / (double) ANIM_TIME;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]