GNOME Bugzilla – Bug 737986
Transparent icon background rendered black on XFCE
Last modified: 2015-04-09 02:15:03 UTC
Created attachment 287830 [details] icon background image Fedora 21 XFCE(xfce4-panel-4.10.1) does not render the transparent color in GtkStatusIcon. Attached the screenshot. Run the following test program to reproduce the bug. --------- #!/usr/bin/python from gi.repository import Gtk status_icon = Gtk.StatusIcon() status_icon.set_from_icon_name('go-up') Gtk.main() ---------
GtkStatusIcon is used by ibus in non-GNOME desktop. But it seems GtkStatusIcon has been deprecated since GTK+ 3.14.
Reminds me of bug 623939, though different issue here.
This problem didn't happen in GTK 3.10.9. It would be a regression between 3.10.9 and 3.14.1.
I assume that this is a theme issue. Can you try to open a GtkInspector window for app, and enter the following in the 'Custom CSS' tab: GtkStatusicon { reset: all; background-color: transparent; } ? To get the inspector window, you can run the app with GTK_DEBUG=interactive
I tried GtkInspector but it seems the custom css does not fix this problem. I also modified gtk/deprecated/gtkstatusicon.c directly below but could not get the transparent background. static void gtk_status_icon_init (GtkStatusIcon *status_icon) { css_provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (css_provider, "GtkTrayIcon { reset: all; background-color: transparent; }", -1, &error); style_context = gtk_widget_get_style_context (priv->tray_icon); gtk_style_context_add_provider (style_context, GTK_STYLE_PROVIDER (css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref (css_provider); } I also tried the resource file but could not get the transparent background. --- gtk/resources/theme/Adwaita/gtk-contained.css.orig +++ gtk/resources/theme/Adwaita/gtk-contained.css @@ -31,7 +31,7 @@ ***************/ .background { color: #2e3436; - background-color: #ededed; } + background-color: transparent; } .background:backdrop { text-shadow: none;
The issue goes away after reverting commit 4a72563 (gtktrayicon-x11: Stop using set_double_buffered). Maybe this was done based on commit b875572 (gtkwidget: Widgets are now always double-buffered) which was later reverted in commit 24b9e91 (Revert "gtkwidget: Widgets are now always double-buffered")? Links to the commits mentioned above: https://git.gnome.org/browse/gtk+/commit/?id=4a72563 https://git.gnome.org/browse/gtk+/commit/?id=b875572 https://git.gnome.org/browse/gtk+/commit/?id=24b9e91 (Note: If you try to reproduce this issue, make sure you're not using a display compositor as it will hide the problem and draw the widget background correctly.)
>(Note: If you try to reproduce this issue, make sure you're not using a display compositor as it will hide the problem and draw the widget background correctly.) I have to chime in here for posterity: Nearly all the applications in elementaryOS's Pantheon desktop are suffering from this and now, finally a clue to what it might be. Without a compositor, various windows and panels have a black box over the screen area they occupy. Perhaps it's a buffering issue.
chiming in is more effective if you reopen the bug...
Sounds like a different bug; this one was fixed in commit 15af0e7.
Unfortunately, this bug has regressed in GTK+ 3.16.0. 'git bisect' points to commit dae4477 as the regression point: commit dae447728db32a5a7162d9216f2e2343837cbae4 Author: Alexander Larsson <alexl@redhat.com> Date: Wed Oct 29 12:35:07 2014 +0100 X11: Pick better system and rgba visuals for GL @Matthias: Should I file a new bug or can this be tracked here? While it's not exactly the same issue (which you fixed), it's very similiar as I describe below. On a Radeon HD 6870 with xf86-video-ati 7.5.0 and Mesa 10.5.1: - The test script from the first comment renders with black background. On a laptop with i3-4005U CPU (Intel HD 4400 graphics) with xf86-video-intel 2.99.917 and Mesa 10.5.1: - The test script from the first comment renders with black background. - Icons which are added to the systray when Xfce starts appear correctly but each icon update is drawn on top of the previous icon.
Does setting GDK_GL=disable in the environment make your problem go away ?
Created attachment 300533 [details] Test tray icon application Starting my test application (attached) with 'GDK_GL=disable ./test' does workaround the issue, but only after commenting out the block that calls get_cached_gl_visuals() in _gdk_x11_screen_update_visuals_for_gl(). There is some more discussion about this issue on bug 738670: https://bugzilla.gnome.org/show_bug.cgi?id=738670#c47
I filed bug 747524 so this can be properly tracked; my suggestion is to close this bug and continue discussion on bug 747524.
The original bug is fixed.