]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktimeline.c
wayland: Report middle and right buttons correctly
[~andy/gtk] / gtk / gtktimeline.c
index 5550e7d47c72cde8d822a210930c9e3f0c0cc06b..db9b0beca2ecac803c811540f8744a8fd4f63ec2 100644 (file)
@@ -186,10 +186,8 @@ gtk_timeline_set_property (GObject      *object,
                            GParamSpec   *pspec)
 {
   GtkTimeline *timeline;
-  GtkTimelinePriv *priv;
 
   timeline = GTK_TIMELINE (object);
-  priv = timeline->priv;
 
   switch (prop_id)
     {
@@ -291,7 +289,7 @@ calculate_progress (gdouble                 linear_progress,
 
       break;
     case GTK_TIMELINE_PROGRESS_EASE:
-      progress = (sinf ((progress - 0.5) * G_PI) + 1) / 2;
+      progress = (sin ((progress - 0.5) * G_PI) + 1) / 2;
       break;
     case GTK_TIMELINE_PROGRESS_EASE_IN:
       progress = pow (progress, 3);
@@ -342,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)
             {
@@ -353,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;
@@ -419,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);