summaryrefslogtreecommitdiff
path: root/gtk/gtkimage.c
diff options
context:
space:
mode:
authorMichael Natterer <mitch@imendio.com>2005-11-16 14:40:41 +0000
committerMichael Natterer <mitch@src.gnome.org>2005-11-16 14:40:41 +0000
commit81be0b4311765c54dedfa16079444b844ef5cf8b (patch)
treeb7d0f558cb222ab95d70e756600e560d28af2253 /gtk/gtkimage.c
parent6e802acd48ec7d04285b91e29871bca11472213e (diff)
downloadgdk-pixbuf-81be0b4311765c54dedfa16079444b844ef5cf8b.tar.gz
call gtk_window_process_updates() so the animation keeps running even if
2005-11-16 Michael Natterer <mitch@imendio.com> * gtk/gtkimage.c (animation_timeout): call gtk_window_process_updates() so the animation keeps running even if the main loop is busy with sources that eat a lot of cpu with high priority. Fixes bug #321444. (gtk_image_new_from_animation): document the fact that the animation will stop running if the main loop is busy with sources that have priorities higher than G_PRIORITY_DEFAULT. * tests/testimage.c: added test case that shows an animation even though a cpu-eating idle function is running.
Diffstat (limited to 'gtk/gtkimage.c')
-rw-r--r--gtk/gtkimage.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 1061253e1..a2f18baca 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -671,7 +671,12 @@ gtk_image_new_from_icon_set (GtkIconSet *icon_set,
* The #GtkImage does not assume a reference to the
* animation; you still need to unref it if you own references.
* #GtkImage will add its own reference rather than adopting yours.
- *
+ *
+ * Note that the animation frames are shown using a timeout with
+ * #G_PRIORITY_DEFAULT. When using animations to indicate busyness,
+ * keep in mind that the animation will only be shown if the main loop
+ * is not busy with something that has a higher priority.
+ *
* Return value: a new #GtkImage widget
**/
GtkWidget*
@@ -1396,9 +1401,12 @@ animation_timeout (gpointer data)
g_timeout_add (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter),
animation_timeout,
image);
-
+
gtk_widget_queue_draw (GTK_WIDGET (image));
+ if (GTK_WIDGET_DRAWABLE (image))
+ gdk_window_process_updates (GTK_WIDGET (image)->window, TRUE);
+
GDK_THREADS_LEAVE ();
return FALSE;