summaryrefslogtreecommitdiff
path: root/src/ui/frames.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-04-23 18:47:49 +0200
committerStefano Karapetsas <[email protected]>2014-04-23 18:47:49 +0200
commitfd2e0db8c8315fd8cecd45a422e9a8f161589841 (patch)
tree5b6d3f63b53ce91113269bb73da5861a05568d78 /src/ui/frames.c
parentd07a3960e9b81aaf9864902e5398eadf801a531b (diff)
downloadmarco-fd2e0db8c8315fd8cecd45a422e9a8f161589841.tar.bz2
marco-fd2e0db8c8315fd8cecd45a422e9a8f161589841.tar.xz
GTK3 fixes
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r--src/ui/frames.c17
1 files changed, 12 insertions, 5 deletions
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
}
}