diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-12-11 15:23:54 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-12-11 15:37:49 -0500 |
commit | 0c076cc8828cd80f1f156a08569199675bf35165 (patch) | |
tree | 06b8861d9125b76c55034d75d2b9a0aa9899fe9e /gladeui/glade-placeholder.c | |
parent | ed15bde7cd00c5a799ae6230b48448b3533493bd (diff) | |
download | glade-0c076cc8828cd80f1f156a08569199675bf35165.tar.gz |
Fix use of GTK+ style context APIs
Make sure to save the style context before querying
with other states. This stops GTK+ from warning, and
makes things work.
Diffstat (limited to 'gladeui/glade-placeholder.c')
-rw-r--r-- | gladeui/glade-placeholder.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gladeui/glade-placeholder.c b/gladeui/glade-placeholder.c index 5fcee12f..09d6e814 100644 --- a/gladeui/glade-placeholder.c +++ b/gladeui/glade-placeholder.c @@ -333,8 +333,12 @@ glade_placeholder_draw (GtkWidget *widget, cairo_t *cr) GdkRGBA c; context = gtk_widget_get_style_context (widget); - gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED | + gtk_style_context_save (context); + gtk_style_context_get_background_color (context, + gtk_style_context_get_state (context) | + GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED, &c); + gtk_style_context_restore (context); ww = w/2.0; hh = h/2.0; |