From fd2e0db8c8315fd8cecd45a422e9a8f161589841 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Wed, 23 Apr 2014 18:47:49 +0200 Subject: GTK3 fixes --- src/ui/frames.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/ui/frames.c') diff --git a/src/ui/frames.c b/src/ui/frames.c index 5c19bd4c..3f8f0113 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -663,16 +663,19 @@ meta_frames_attach_style (MetaFrames *frames, MetaUIFrame *frame) { if (frame->style != NULL) +#if GTK_CHECK_VERSION(3, 0, 0) + g_object_unref (frame->style); +#else gtk_style_detach (frame->style); +#endif +#if GTK_CHECK_VERSION(3, 0, 0) + 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 */ - #if GTK_CHECK_VERSION(3, 0, 0) - g_object_ref (gtk_widget_get_style (GTK_WIDGET (frames))); - frame->style = gtk_style_attach (gtk_widget_get_style (GTK_WIDGET (frames)), frame->window); - #else g_object_ref (GTK_WIDGET (frames)->style); frame->style = gtk_style_attach (GTK_WIDGET (frames)->style, frame->window); - #endif +#endif } void @@ -2926,8 +2929,12 @@ meta_frames_set_window_background (MetaFrames *frames, } else { +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_style_context_set_background (frame->style, frame->window); +#else gtk_style_set_background (frame->style, frame->window, GTK_STATE_NORMAL); +#endif } } -- cgit v1.2.1