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
This commit is contained in:
Jonas Ådahl 2020-04-21 18:50:15 +02:00 committed by Georges Basile Stavracas Neto
parent 482c655590
commit 918b3eeb42
3 changed files with 11 additions and 8 deletions

View File

@ -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",

View File

@ -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);

View File

@ -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);