[mutter] window-actor: Add "size-changed" signal



commit ad707be01ea9c3a7186a12ed8077d95d468ceee6
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jan 25 21:08:43 2011 +0100

    window-actor: Add "size-changed" signal
    
    Emit a signal when the window size changes. While it is already
    possible to connect to notify::allocation (or width/height), the
    new signal is emitted outside a clutter allocation cycle, which
    makes it more convenient when adjusting an actor's size/position
    in response.

 src/compositor/meta-window-actor.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index e3c0cd9..b387e03 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -24,6 +24,14 @@
 #include "meta-shaped-texture.h"
 #include "meta-window-actor-private.h"
 
+enum {
+  SIZE_CHANGED,
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = {0};
+
+
 struct _MetaWindowActorPrivate
 {
   XWindowAttributes attrs;
@@ -275,6 +283,14 @@ meta_window_actor_class_init (MetaWindowActorClass *klass)
   g_object_class_install_property (object_class,
                                    PROP_SHADOW_CLASS,
                                    pspec);
+
+  signals[SIZE_CHANGED] =
+    g_signal_new ("size-changed",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  0, NULL, NULL,
+                  g_cclosure_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);
 }
 
 static void
@@ -1607,6 +1623,8 @@ meta_window_actor_update_bounding_region (MetaWindowActor *self,
    */
   if (!priv->shaped)
     meta_window_actor_invalidate_shadow (self);
+
+  g_signal_emit (self, signals[SIZE_CHANGED], 0);
 }
 
 static void



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