[gnome-shell] st/theme-node-transition: Pass actor when constructing timeline



commit 918b3eeb4277bf52944e44ba5e74a4e270328d0d
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Apr 21 18:50:15 2020 +0200

    st/theme-node-transition: Pass actor when constructing timeline
    
    Timelines now take an actor, to be able to derive an appropriate frame
    clock, so pass the one of the actor we're transitioning on.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1299

 src/st/st-theme-node-transition.c | 9 +++++----
 src/st/st-theme-node-transition.h | 7 ++++---
 src/st/st-widget.c                | 3 ++-
 3 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/st/st-theme-node-transition.c b/src/st/st-theme-node-transition.c
index 42232bd2dd..b7366653d4 100644
--- a/src/st/st-theme-node-transition.c
+++ b/src/st/st-theme-node-transition.c
@@ -84,10 +84,11 @@ on_timeline_new_frame (ClutterTimeline       *timeline,
 }
 
 StThemeNodeTransition *
-st_theme_node_transition_new (StThemeNode *from_node,
-                              StThemeNode *to_node,
+st_theme_node_transition_new (ClutterActor          *actor,
+                              StThemeNode           *from_node,
+                              StThemeNode           *to_node,
                               StThemeNodePaintState *old_paint_state,
-                              guint        duration)
+                              unsigned int           duration)
 {
   StThemeNodeTransition *transition;
   g_return_val_if_fail (ST_IS_THEME_NODE (from_node), NULL);
@@ -103,7 +104,7 @@ st_theme_node_transition_new (StThemeNode *from_node,
   st_theme_node_paint_state_copy (&transition->priv->old_paint_state,
                                   old_paint_state);
 
-  transition->priv->timeline = clutter_timeline_new (duration);
+  transition->priv->timeline = clutter_timeline_new_for_actor (actor, duration);
 
   transition->priv->timeline_completed_id =
     g_signal_connect (transition->priv->timeline, "completed",
diff --git a/src/st/st-theme-node-transition.h b/src/st/st-theme-node-transition.h
index 61f82d295f..e7420e6d53 100644
--- a/src/st/st-theme-node-transition.h
+++ b/src/st/st-theme-node-transition.h
@@ -32,10 +32,11 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (StThemeNodeTransition, st_theme_node_transition,
                       ST, THEME_NODE_TRANSITION, GObject)
 
-StThemeNodeTransition *st_theme_node_transition_new (StThemeNode *from_node,
-                                                     StThemeNode *to_node,
+StThemeNodeTransition *st_theme_node_transition_new (ClutterActor          *actor,
+                                                     StThemeNode           *from_node,
+                                                     StThemeNode           *to_node,
                                                      StThemeNodePaintState *old_paint_state,
-                                                     guint        duration);
+                                                     guint                  duration);
 
 void  st_theme_node_transition_update   (StThemeNodeTransition *transition,
                                          StThemeNode           *new_node);
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 6fd7a11a9d..29ed553370 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -1687,7 +1687,8 @@ st_widget_recompute_style (StWidget    *widget,
            */
 
           priv->transition_animation =
-            st_theme_node_transition_new (old_theme_node,
+            st_theme_node_transition_new (CLUTTER_ACTOR (widget),
+                                          old_theme_node,
                                           new_theme_node,
                                           current_paint_state (widget),
                                           transition_duration);


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