summaryrefslogtreecommitdiff
path: root/src/ui/frames.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r--src/ui/frames.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index f5f0c7d4..99260936 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -161,6 +161,24 @@ meta_frames_get_type (void)
#endif
+static GObject *
+meta_frames_constructor (GType gtype,
+ guint n_properties,
+ GObjectConstructParam *properties)
+{
+ GObject *object;
+ GObjectClass *gobject_class;
+
+ gobject_class = G_OBJECT_CLASS (parent_class);
+ object = gobject_class->constructor (gtype, n_properties, properties);
+
+ g_object_set (object,
+ "type", GTK_WINDOW_POPUP,
+ NULL);
+
+ return object;
+}
+
static void
meta_frames_class_init (MetaFramesClass *class)
{
@@ -180,6 +198,7 @@ meta_frames_class_init (MetaFramesClass *class)
parent_class = g_type_class_peek_parent (class);
#endif
+ gobject_class->constructor = meta_frames_constructor;
gobject_class->finalize = meta_frames_finalize;
#if !GTK_CHECK_VERSION(3, 0, 0)
object_class->destroy = meta_frames_destroy;
@@ -245,10 +264,6 @@ prefs_changed_callback (MetaPreference pref,
static void
meta_frames_init (MetaFrames *frames)
{
- #if !GTK_CHECK_VERSION(3, 0, 0)
- GTK_WINDOW (frames)->type = GTK_WINDOW_POPUP;
- #endif
-
frames->text_heights = g_hash_table_new (NULL, NULL);
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
@@ -664,8 +679,9 @@ meta_frames_attach_style (MetaFrames *frames,
frame->style = g_object_ref (gtk_widget_get_style_context (GTK_WIDGET (frames)));
#else
/* Weirdly, gtk_style_attach() steals a reference count from the style passed in */
- g_object_ref (GTK_WIDGET (frames)->style);
- frame->style = gtk_style_attach (GTK_WIDGET (frames)->style, frame->window);
+ g_object_ref (gtk_widget_get_style (GTK_WIDGET (frames)));
+ frame->style = gtk_style_attach (gtk_widget_get_style (GTK_WIDGET (frames)),
+ frame->window);
#endif
}