From 61933f8fa3be5097549c754da84f5814dc82ef7b Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Wed, 12 Feb 2014 19:03:34 +0300 Subject: [PATCH] Fix transparency with alpha being 100 (Bug 10658) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A panel with style set to 'none (use system style)' and alpha to 100 is still affected by the problem which can be triggered manually by launching another indicator after the initial panel start. This patch removes an unneeded check that was causing the issue. Thanks to Thaddäus Tintenfisch for reporting the issue and finding the exact part of the code that needed to be corrected. --- wrapper/wrapper-plug.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/wrapper/wrapper-plug.c b/wrapper/wrapper-plug.c index 6832a35..e3c3d61 100644 --- a/wrapper/wrapper-plug.c +++ b/wrapper/wrapper-plug.c @@ -222,28 +222,24 @@ wrapper_plug_draw (GtkWidget *widget, else { alpha = gtk_widget_is_composited (GTK_WIDGET (plug)) ? plug->background_alpha : 1.00; + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); - if (alpha < 1.00 || plug->background_color != NULL) + /* get the background gdk color */ + if (plug->background_color != NULL) { - cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); - - /* get the background gdk color */ - if (plug->background_color != NULL) - { - color = plug->background_color; - cairo_set_source_rgba (cr, PANEL_GDKCOLOR_TO_DOUBLE (color), alpha); - } - else - { - style = gtk_widget_get_style_context (widget); - gtk_style_context_get_background_color (style, GTK_STATE_FLAG_NORMAL, &rgba); - rgba.alpha = alpha; - gdk_cairo_set_source_rgba (cr, &rgba); - } - - /* draw the background color */ - cairo_paint (cr); + color = plug->background_color; + cairo_set_source_rgba (cr, PANEL_GDKCOLOR_TO_DOUBLE (color), alpha); } + else + { + style = gtk_widget_get_style_context (widget); + gtk_style_context_get_background_color (style, GTK_STATE_FLAG_NORMAL, &rgba); + rgba.alpha = alpha; + gdk_cairo_set_source_rgba (cr, &rgba); + } + + /* draw the background color */ + cairo_paint (cr); } cairo_restore(cr); -- 1.8.5.4