summaryrefslogtreecommitdiff
path: root/capplets/display
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-02-28 12:03:12 +0100
committerraveit65 <[email protected]>2016-02-28 12:03:12 +0100
commitab49eb914d4f53a6d22970762d3bab151dc5f6a4 (patch)
tree406ad4614b62218a8018c8f69d887f12023f7e47 /capplets/display
parentb7213a4a71484af6c93de849bbfd500146895e50 (diff)
downloadmate-control-center-ab49eb914d4f53a6d22970762d3bab151dc5f6a4.tar.bz2
mate-control-center-ab49eb914d4f53a6d22970762d3bab151dc5f6a4.tar.xz
GTK+3 display: Get values from GtkStyleContext states properly
Diffstat (limited to 'capplets/display')
-rw-r--r--capplets/display/xrandr-capplet.c17
1 files 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,