summaryrefslogtreecommitdiff
path: root/gtk/gtktimeline.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-04-14 08:56:07 -0400
committerMatthias Clasen <mclasen@redhat.com>2011-04-14 08:58:48 -0400
commitc43ada95aa5d398d9bf426a31a7af462b10126fd (patch)
treed0dec97693213c1e775c8de3029f6f3707790bbc /gtk/gtktimeline.c
parentdd28e22aa147d4763ebdf5504a54183e641c8a4d (diff)
downloadgtk+-c43ada95aa5d398d9bf426a31a7af462b10126fd.tar.gz
GtkTimeline: don't look when animations are disabled
Otherwise, we end up doing maximal work with minimal effect, and bring the X server to 100% CPU. Note that this makes spinner widgets look really unclear, but they really have to be changed to adapt to enable-animations == FALSE at the widget level.
Diffstat (limited to 'gtk/gtktimeline.c')
-rw-r--r--gtk/gtktimeline.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk/gtktimeline.c b/gtk/gtktimeline.c
index 18d3f950f5..db9b0beca2 100644
--- a/gtk/gtktimeline.c
+++ b/gtk/gtktimeline.c
@@ -340,7 +340,13 @@ gtk_timeline_run_frame (GtkTimeline *timeline)
if ((priv->direction == GTK_TIMELINE_DIRECTION_FORWARD && progress == 1.0) ||
(priv->direction == GTK_TIMELINE_DIRECTION_BACKWARD && progress == 0.0))
{
- if (!priv->loop)
+ gboolean loop;
+
+ loop = priv->loop && priv->animations_enabled;
+
+ if (loop)
+ _gtk_timeline_rewind (timeline);
+ else
{
if (priv->source_id)
{
@@ -351,8 +357,6 @@ gtk_timeline_run_frame (GtkTimeline *timeline)
g_signal_emit (timeline, signals [FINISHED], 0);
return FALSE;
}
- else
- _gtk_timeline_rewind (timeline);
}
return TRUE;
@@ -417,7 +421,7 @@ _gtk_timeline_start (GtkTimeline *timeline)
g_object_get (settings, "gtk-enable-animations", &enable_animations, NULL);
}
- priv->animations_enabled = (enable_animations == TRUE);
+ priv->animations_enabled = enable_animations;
g_signal_emit (timeline, signals [STARTED], 0);