Commit fe89e710 authored by Benjamin Otte's avatar Benjamin Otte

stylecontext: Add public API to stop animations

... and use it.

Of course, there still are no animations, so we don't turn anything off
yet.
parent a2408088
......@@ -765,7 +765,7 @@ gtk_style_context_finalize (GObject *object)
style_context = GTK_STYLE_CONTEXT (object);
priv = style_context->priv;
gtk_style_context_stop_animating (style_context);
_gtk_style_context_stop_animations (style_context);
/* children hold a reference to us */
g_assert (priv->children == NULL);
......@@ -1023,6 +1023,8 @@ _gtk_style_context_set_widget (GtkStyleContext *context,
context->priv->widget = widget;
_gtk_style_context_stop_animations (context);
_gtk_style_context_queue_invalidate (context, GTK_CSS_CHANGE_ANY_SELF);
}
......@@ -2915,6 +2917,17 @@ gtk_style_context_do_invalidate (GtkStyleContext *context)
priv->invalidating_context = FALSE;
}
void
_gtk_style_context_stop_animations (GtkStyleContext *context)
{
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
if (!gtk_style_context_is_animating (context))
return;
gtk_style_context_stop_animating (context);
}
void
_gtk_style_context_validate (GtkStyleContext *context,
gint64 timestamp,
......
......@@ -52,6 +52,8 @@ void _gtk_style_context_get_cursor_color (GtkStyleContext *c
GdkRGBA *primary_color,
GdkRGBA *secondary_color);
void _gtk_style_context_stop_animations (GtkStyleContext *context);
G_END_DECLS
#endif /* __GTK_STYLE_CONTEXT_PRIVATE_H__ */
......@@ -4126,6 +4126,9 @@ gtk_widget_real_hide (GtkWidget *widget)
if (gtk_widget_get_mapped (widget))
gtk_widget_unmap (widget);
if (widget->priv->context)
_gtk_style_context_stop_animations (widget->priv->context);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment