diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2014-12-05 12:58:28 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2014-12-05 12:58:28 +0200 |
commit | f201335eb64568bc12d46e0294529032747a93f2 (patch) | |
tree | d2f61acab8f7454bf3b778b231cb40f2df8c4c52 /src/ui/draw-workspace.c | |
parent | 78eed7293f9b0819f125dc14efd0a2b1b79d2096 (diff) | |
download | metacity-f201335eb64568bc12d46e0294529032747a93f2.tar.gz |
don't use deprecated gtk_style_context_get_background_color
Replace gtk_style_context_get_background_color with local static
function get_background_color that does exactly same thing.
Thanks to Lucian Langa for reporting bug.
Diffstat (limited to 'src/ui/draw-workspace.c')
-rw-r--r-- | src/ui/draw-workspace.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/ui/draw-workspace.c b/src/ui/draw-workspace.c index 3a0b65a3..d8778ad6 100644 --- a/src/ui/draw-workspace.c +++ b/src/ui/draw-workspace.c @@ -64,6 +64,25 @@ get_window_rect (const WnckWindowDisplayInfo *win, } 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); +} + +static void draw_window (GtkWidget *widget, cairo_t *cr, const WnckWindowDisplayInfo *win, @@ -87,7 +106,7 @@ draw_window (GtkWidget *widget, if (is_active) meta_gtk_style_get_light_color (style, state, &color); else - gtk_style_context_get_background_color (style, state, &color); + get_background_color (style, state, &color); gdk_cairo_set_source_rgba (cr, &color); cairo_rectangle (cr, |