From 7d0758e3eaad1b9dab8ba1eae935a3a93ec5882b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Sun, 6 Dec 2015 12:17:12 +0200 Subject: [PATCH] Workaround for changes in GTK+ 3.19 After GTK+3 was updated to 3.19.x $HOME/.xsession-errors was flooded with the warning messages: (wrapper-2.0:24577): Gtk-WARNING **: State 0 for XfcePanelWindowWrapper 0x253e2c0 doesn't match state 128 set via gtk_style_context_set_state () https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/ --- wrapper/wrapper-plug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wrapper/wrapper-plug.c b/wrapper/wrapper-plug.c index e3c3d61..661ddff 100644 --- a/wrapper/wrapper-plug.c +++ b/wrapper/wrapper-plug.c @@ -233,7 +233,12 @@ wrapper_plug_draw (GtkWidget *widget, else { style = gtk_widget_get_style_context (widget); - gtk_style_context_get_background_color (style, GTK_STATE_FLAG_NORMAL, &rgba); + + gtk_style_context_save (style); + gtk_style_context_set_state (style, GTK_STATE_FLAG_NORMAL); + gtk_style_context_get_background_color (style, gtk_style_context_get_state (style), &rgba); + gtk_style_context_restore (style); + rgba.alpha = alpha; gdk_cairo_set_source_rgba (cr, &rgba); } -- 2.6.3