[gnome-settings-daemon/reusable-osd-window] Set the window type in the constructor



commit 3ebbb6a49a417652f8aeff7d826e5f532ee52d80
Author: Federico Mena Quintero <federico novell com>
Date:   Mon Jan 4 16:34:23 2010 -0600

    Set the window type in the constructor
    
    The window's type is a construct-time property anyway.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 plugins/common/gsd-osd-window.c |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/plugins/common/gsd-osd-window.c b/plugins/common/gsd-osd-window.c
index 7ead3e7..c0c01aa 100644
--- a/plugins/common/gsd-osd-window.c
+++ b/plugins/common/gsd-osd-window.c
@@ -413,12 +413,34 @@ gsd_osd_window_real_realize (GtkWidget *widget)
         cairo_destroy (cr);
 }
 
+static GObject *
+gsd_osd_window_constructor (GType                  type,
+                            guint                  n_construct_properties,
+                            GObjectConstructParam *construct_params)
+{
+        GObject *object;
+
+        object = G_OBJECT_CLASS (gsd_osd_window_parent_class)->constructor (type, n_construct_properties, construct_params);
+
+        g_object_set (object,
+                      "type", GTK_WINDOW_POPUP,
+                      "type-hint", GDK_WINDOW_TYPE_HINT_NOTIFICATION,
+                      "skip-taskbar-hint", TRUE,
+                      "skip-pager-hint", TRUE,
+                      "focus-on-map", FALSE,
+                      NULL);
+
+        return object;
+}
+
 static void
 gsd_osd_window_class_init (GsdOsdWindowClass *klass)
 {
         GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
         GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
+        gobject_class->constructor = gsd_osd_window_constructor;
+
         widget_class->show = gsd_osd_window_real_show;
         widget_class->hide = gsd_osd_window_real_hide;
         widget_class->realize = gsd_osd_window_real_realize;
@@ -492,14 +514,6 @@ gsd_osd_window_init (GsdOsdWindow *window)
         } else {
 		gtk_container_set_border_width (GTK_CONTAINER (window), 12);
         }
-
-        g_object_set (window,
-                      "type", GTK_WINDOW_POPUP,
-                      "type-hint", GDK_WINDOW_TYPE_HINT_NOTIFICATION,
-                      "skip-taskbar-hint", TRUE,
-                      "skip-pager-hint", TRUE,
-                      "focus-on-map", FALSE,
-                      NULL);
 }
 
 GtkWidget *



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