[totem/gnome-3-8] backend: prevent excessive relayouts stopping animations
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/gnome-3-8] backend: prevent excessive relayouts stopping animations
- Date: Thu, 25 Jul 2013 17:59:04 +0000 (UTC)
commit 487510bd742b33b31e8cff8c06bba503f8d3a382
Author: Lionel Landwerlin <llandwerlin gmail com>
Date: Tue Jul 2 18:19:40 2013 +0100
backend: prevent excessive relayouts stopping animations
Every time the elapsed time widget is updating its content, this
triggers a relayout that propagates to the toplevel actor (ie the
stage). Because of the way constraints work, when a relayout is queued
on an actor that is the source of a constraint, it will automatically
queue a relayout on the destination of the constraint too. And because
of the constraints applied between the stage and some of the children,
any relayout triggered by any actor within the scene was relayouting
almost everything, and therefore stopping animations.
This patch removes the usage of constraints in favor of layout
managers that don't have the annoying property of triggering relayouts
on everything.
https://bugzilla.gnome.org/show_bug.cgi?id=700051
Conflicts:
src/backend/bacon-video-widget.c
src/backend/bacon-video-widget.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 335c417..fc2f5bf 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -5889,7 +5889,6 @@ bacon_video_widget_initable_init (GInitable *initable,
GstElement *audio_sink = NULL, *video_sink = NULL;
gchar *version_str;
GstPlayFlags flags;
- ClutterConstraint *constraint;
GstElement *audio_bin, *audio_converter;
GstPad *audio_pad;
@@ -5961,7 +5960,10 @@ bacon_video_widget_initable_init (GInitable *initable,
bvw->priv->auto_resize = FALSE;
bvw->priv->stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (bvw));
- clutter_actor_set_background_color (CLUTTER_ACTOR (bvw->priv->stage), CLUTTER_COLOR_Black);
+ clutter_actor_set_layout_manager (bvw->priv->stage,
+ clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_FILL,
CLUTTER_BIN_ALIGNMENT_FILL));
+ clutter_actor_set_name (bvw->priv->stage, "stage");
+ clutter_actor_set_background_color (bvw->priv->stage, CLUTTER_COLOR_Black);
/* Video sink, with aspect frame */
bvw->priv->texture = g_object_new (CLUTTER_TYPE_TEXTURE,
@@ -5975,8 +5977,6 @@ bacon_video_widget_initable_init (GInitable *initable,
bvw->priv->logo = clutter_texture_new ();
totem_aspect_frame_set_child (TOTEM_ASPECT_FRAME (bvw->priv->logo_frame), bvw->priv->logo);
clutter_actor_add_child (CLUTTER_ACTOR (bvw->priv->stage), bvw->priv->logo_frame);
- constraint = clutter_bind_constraint_new (bvw->priv->stage, CLUTTER_BIND_SIZE, 0.0);
- clutter_actor_add_constraint_with_name (bvw->priv->logo_frame, "size", constraint);
clutter_actor_hide (CLUTTER_ACTOR (bvw->priv->logo_frame));
/* The video */
@@ -5985,8 +5985,6 @@ bacon_video_widget_initable_init (GInitable *initable,
totem_aspect_frame_set_child (TOTEM_ASPECT_FRAME (bvw->priv->frame), bvw->priv->texture);
clutter_actor_add_child (CLUTTER_ACTOR (bvw->priv->stage), bvw->priv->frame);
- constraint = clutter_bind_constraint_new (bvw->priv->stage, CLUTTER_BIND_SIZE, 0.0);
- clutter_actor_add_constraint_with_name (bvw->priv->frame, "size", constraint);
clutter_actor_set_child_above_sibling (CLUTTER_ACTOR (bvw->priv->stage),
CLUTTER_ACTOR (bvw->priv->logo_frame),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]