From ab49eb914d4f53a6d22970762d3bab151dc5f6a4 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Sun, 28 Feb 2016 12:03:12 +0100 Subject: GTK+3 display: Get values from GtkStyleContext states properly --- capplets/display/xrandr-capplet.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 6f5e2a2c..e1abec6b 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -1703,9 +1703,13 @@ paint_background (FooScrollArea *area, #endif #if GTK_CHECK_VERSION (3, 0, 0) - gtk_style_context_get (widget_style, GTK_STATE_FLAG_SELECTED, - GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &base_color, - NULL); + gtk_style_context_save (widget_style); + gtk_style_context_set_state (widget_style, GTK_STATE_FLAG_SELECTED); + gtk_style_context_get (widget_style, + gtk_style_context_get_state (widget_style), + GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &base_color, + NULL); + gtk_style_context_restore (widget_style); gdk_cairo_set_source_rgba(cr, base_color); gdk_rgba_free (base_color); #else @@ -1724,7 +1728,12 @@ paint_background (FooScrollArea *area, foo_scroll_area_add_input_from_fill (area, cr, on_canvas_event, NULL); #if GTK_CHECK_VERSION (3, 0, 0) - mate_desktop_gtk_style_get_dark_color (widget_style, GTK_STATE_FLAG_SELECTED, &dark_color); + gtk_style_context_save (widget_style); + gtk_style_context_set_state (widget_style, GTK_STATE_FLAG_SELECTED); + mate_desktop_gtk_style_get_dark_color (widget_style, + gtk_style_context_get_state (widget_style), + &dark_color); + gtk_style_context_restore (widget_style); gdk_cairo_set_source_rgba (cr, &dark_color); #else cairo_set_source_rgb (cr, -- cgit v1.2.1