[mutter] window-actor: Don't connect to allocation-changed



commit 6954d23444b61b5edaa5680bc1d18f7f963de75e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jun 26 11:47:52 2014 -0400

    window-actor: Don't connect to allocation-changed
    
    This can cause allocation loops. Connect to size-changed to update the
    shape instead.

 src/compositor/meta-window-actor.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index b30faf7..5415ac3 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -76,7 +76,6 @@ struct _MetaWindowActorPrivate
   gint64            frame_drawn_time;
 
   guint             repaint_scheduled_id;
-  guint             allocation_changed_id;
 
   /*
    * These need to be counters rather than flags, since more plugins
@@ -273,12 +272,11 @@ window_appears_focused_notify (MetaWindow *mw,
 }
 
 static void
-surface_allocation_changed_notify (ClutterActor           *actor,
-                                   const ClutterActorBox  *allocation,
-                                   ClutterAllocationFlags  flags,
-                                   MetaWindowActor        *self)
+window_size_changed (MetaWindow *mw,
+                     gpointer    data)
 {
-  meta_window_actor_sync_actor_geometry (self, FALSE);
+  MetaWindowActor *self = META_WINDOW_ACTOR (data);
+
   meta_window_actor_update_shape (self);
 }
 
@@ -371,8 +369,6 @@ set_surface (MetaWindowActor  *self,
     {
       g_signal_handler_disconnect (priv->surface, priv->repaint_scheduled_id);
       priv->repaint_scheduled_id = 0;
-      g_signal_handler_disconnect (priv->surface, priv->allocation_changed_id);
-      priv->allocation_changed_id = 0;
       clutter_actor_remove_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
       g_object_unref (priv->surface);
     }
@@ -384,8 +380,6 @@ set_surface (MetaWindowActor  *self,
       g_object_ref_sink (priv->surface);
       priv->repaint_scheduled_id = g_signal_connect (priv->surface, "repaint-scheduled",
                                                      G_CALLBACK (surface_repaint_scheduled), self);
-      priv->allocation_changed_id = g_signal_connect (priv->surface, "allocation-changed",
-                                                      G_CALLBACK (surface_allocation_changed_notify), self);
       clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
 
       /* If the previous surface actor was frozen, start out
@@ -495,6 +489,8 @@ meta_window_actor_set_property (GObject      *object,
       priv->window = g_value_dup_object (value);
       g_signal_connect_object (priv->window, "notify::appears-focused",
                                G_CALLBACK (window_appears_focused_notify), self, 0);
+      g_signal_connect_object (priv->window, "size-changed",
+                               G_CALLBACK (window_size_changed), self, 0);
       break;
     case PROP_NO_SHADOW:
       {


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