forked from AuroraMiddleware/gtk
Robustness fixes for drag cancel animation
gtk_widget_get_frame_clock() can return NULL. Deal with that by silently stopping the drag cancel animation in this case.
This commit is contained in:
parent
34c29d8d3c
commit
4f1780c782
18
gtk/gtkdnd.c
18
gtk/gtkdnd.c
@ -3942,16 +3942,24 @@ gtk_drag_anim_destroy (GtkDragAnim *anim)
|
||||
static gboolean
|
||||
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);
|
||||
GtkWidget *icon_window;
|
||||
GdkFrameClock *frame_clock;
|
||||
gint64 current_time;
|
||||
int hot_x, hot_y;
|
||||
double f = (current_time - anim->start_time) / (double) ANIM_TIME;
|
||||
double f;
|
||||
double t;
|
||||
|
||||
frame_clock = gtk_widget_get_frame_clock (info->widget);
|
||||
|
||||
if (!frame_clock)
|
||||
return G_SOURCE_REMOVE;
|
||||
|
||||
current_time = gdk_frame_clock_get_frame_time (frame_clock);
|
||||
|
||||
f = (current_time - anim->start_time) / (double) ANIM_TIME;
|
||||
|
||||
if (f >= 1.0)
|
||||
return G_SOURCE_REMOVE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user