summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-14 18:59:28 +0200
committerraveit65 <[email protected]>2016-07-02 10:26:46 +0200
commitc0f4ab4692744ab08f4f38880e78db0bfdc4d02f (patch)
treefce1eb53134046e6ed4080afd96992129ff25a15
parentb9b4ff6d1e0b977ce815561f1b8ea16f7ce16aec (diff)
downloadmate-desktop-c0f4ab4692744ab08f4f38880e78db0bfdc4d02f.tar.bz2
mate-desktop-c0f4ab4692744ab08f4f38880e78db0bfdc4d02f.tar.xz
GTK+-3 mate-bg-crossfade: port to GtkStyleContext
with help from Alexei Sorokin
-rw-r--r--libmate-desktop/mate-bg-crossfade.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libmate-desktop/mate-bg-crossfade.c b/libmate-desktop/mate-bg-crossfade.c
index 0ec7d33..484f252 100644
--- a/libmate-desktop/mate-bg-crossfade.c
+++ b/libmate-desktop/mate-bg-crossfade.c
@@ -273,9 +273,21 @@ tile_surface (cairo_surface_t *surface,
}
else
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkStyleContext *context;
+ GdkRGBA bg;
+ context = gtk_style_context_new ();
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (gtk_css_provider_get_default ()),
+ GTK_STYLE_PROVIDER_PRIORITY_THEME);
+ gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
+ gdk_cairo_set_source_rgba(cr, &bg);
+ g_object_unref (G_OBJECT (context));
+#else
GtkStyle *style;
style = gtk_widget_get_default_style ();
gdk_cairo_set_source_color(cr, &style->bg[GTK_STATE_NORMAL]);
+#endif
}
cairo_paint (cr);