[mutter/meego-1.0: 5/30] [MutterWindow] added "window-destroyed" signal



commit d97b8623cc43b2707153c9b2841c4ab2bc2409dc
Author: Tomas Frydrych <tf linux intel com>
Date:   Tue Oct 6 15:25:25 2009 +0100

    [MutterWindow] added "window-destroyed" signal
    
    This signal gets emitted upon entry into mutter_window_destroyed() before the
    MutterWindow object is modified. It can be used by a plugin to track when a
    window is removed. Unlike the plugin destroy() vfunction, this signal gets
    emitted regardless whether the window is currently visible to the compositor
    or not, and unlike the ClutterActor::destroy signal, this signal is emitted
    early, so that all the MutterWindow and MetaWindow resources are still valid.

 src/compositor/mutter-window.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/mutter-window.c b/src/compositor/mutter-window.c
index 0bbf2f6..bca95dd 100644
--- a/src/compositor/mutter-window.c
+++ b/src/compositor/mutter-window.c
@@ -85,6 +85,14 @@ enum
   PROP_MCW_NO_SHADOW,
 };
 
+enum
+{
+  WINDOW_DESTROYED,
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
 static void mutter_window_dispose    (GObject *object);
 static void mutter_window_finalize   (GObject *object);
 static void mutter_window_constructed (GObject *object);
@@ -216,6 +224,15 @@ mutter_window_class_init (MutterWindowClass *klass)
   g_object_class_install_property (object_class,
                                    PROP_MCW_NO_SHADOW,
                                    pspec);
+
+  signals[WINDOW_DESTROYED] =
+    g_signal_new ("window-destroyed",
+		  G_TYPE_FROM_CLASS (object_class),
+                  G_SIGNAL_RUN_LAST,
+		  0,
+		  NULL, NULL,
+		  g_cclosure_marshal_VOID__VOID,
+		  G_TYPE_NONE, 0);
 }
 
 static void
@@ -971,6 +988,8 @@ mutter_window_destroy (MutterWindow *self)
   MetaCompScreen      *info;
   MutterWindowPrivate *priv;
 
+  g_signal_emit (self, signals[WINDOW_DESTROYED], 0);
+
   priv = self->priv;
 
   window = priv->window;



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