diff options
author | Wolfgang Ulbrich <[email protected]> | 2015-11-13 18:29:14 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2015-12-02 12:08:58 +0100 |
commit | e51cc4ecddbd57cb900610ac8f1dcc0b350b8d68 (patch) | |
tree | b4db37204a31c05896b618ec18bdce80bd01bcaf /src/ui | |
parent | d525c5cd5f5a759911b2d1083e101ce58b07a69a (diff) | |
download | marco-e51cc4ecddbd57cb900610ac8f1dcc0b350b8d68.tar.bz2 marco-e51cc4ecddbd57cb900610ac8f1dcc0b350b8d68.tar.xz |
Gtk+-3.16 draw-workspace.c: don't use deprecated gtk_style_context_get_background_color
partially taken from:
https://git.gnome.org/browse/metacity/commit/?id=33ad43f
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/draw-workspace.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ui/draw-workspace.c b/src/ui/draw-workspace.c index 4feb25c9..694dcae1 100644 --- a/src/ui/draw-workspace.c +++ b/src/ui/draw-workspace.c @@ -65,6 +65,27 @@ get_window_rect (const WnckWindowDisplayInfo *win, rect->height = height; } +#if GTK_CHECK_VERSION (3, 16, 0) +static void +get_background_color (GtkStyleContext *context, + GtkStateFlags state, + GdkRGBA *color) +{ + GdkRGBA *c; + + g_return_if_fail (color != NULL); + g_return_if_fail (GTK_IS_STYLE_CONTEXT (context)); + + gtk_style_context_get (context, + state, + "background-color", &c, + NULL); + + *color = *c; + gdk_rgba_free (c); +} +#endif + static void draw_window (GtkWidget *widget, #if GTK_CHECK_VERSION(3, 0, 0) @@ -107,7 +128,11 @@ draw_window (GtkWidget *widget, if (is_active) meta_gtk_style_get_light_color (style, state, &color); else +#if GTK_CHECK_VERSION (3, 16, 0) + get_background_color (style, state, &color); +#else gtk_style_context_get_background_color (style, state, &color); +#endif gdk_cairo_set_source_rgba (cr, &color); #else style = gtk_widget_get_style (widget); |