From b04c37a7641b474ca066627da27d42e6134c4e17 Mon Sep 17 00:00:00 2001 From: infirit Date: Mon, 14 Sep 2015 19:07:06 +0200 Subject: Remove deprecated GTK+ symbols and use accessor functions Direct struct access has been deprecated, so use the appropriate replacements to build with GSEAL enabled. --- src/ui/frames.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/ui/frames.c') 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 } -- cgit v1.2.1