After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737986 - Transparent icon background rendered black on XFCE
Transparent icon background rendered black on XFCE
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkStatusIcon
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-10-06 10:26 UTC by Takao Fujiwara
Modified: 2015-04-09 02:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
icon background image (5.89 KB, image/png)
2014-10-06 10:26 UTC, Takao Fujiwara
Details
Test tray icon application (794 bytes, text/x-csrc)
2015-03-29 06:43 UTC, Evangelos Foutras
Details

Description Takao Fujiwara 2014-10-06 10:26:02 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()
---------
Comment 1 Takao Fujiwara 2014-10-06 10:32:33 UTC
GtkStatusIcon is used by ibus in non-GNOME desktop.
But it seems GtkStatusIcon has been deprecated since GTK+ 3.14.
Comment 2 André Klapper 2014-10-06 20:58:33 UTC
Reminds me of bug 623939, though different issue here.
Comment 3 Takao Fujiwara 2014-10-14 10:20:28 UTC
This problem didn't happen in GTK 3.10.9.
It would be a regression between 3.10.9 and 3.14.1.
Comment 4 Matthias Clasen 2014-10-14 23:53:00 UTC
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
Comment 5 Takao Fujiwara 2014-10-15 07:59:27 UTC
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;
Comment 6 Evangelos Foutras 2014-10-15 09:16:29 UTC
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.)
Comment 7 Que Quotion 2015-02-26 02:17:08 UTC
>(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.
Comment 8 Matthias Clasen 2015-02-26 21:18:26 UTC
chiming in is more effective if you reopen the bug...
Comment 9 Evangelos Foutras 2015-02-26 23:59:46 UTC
Sounds like a different bug; this one was fixed in commit 15af0e7.
Comment 10 Evangelos Foutras 2015-03-26 07:39:48 UTC
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.
Comment 11 Matthias Clasen 2015-03-29 01:20:28 UTC
Does setting GDK_GL=disable in the environment make your problem go away ?
Comment 12 Evangelos Foutras 2015-03-29 06:43:52 UTC
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
Comment 13 Evangelos Foutras 2015-04-08 17:21:50 UTC
I filed bug 747524 so this can be properly tracked; my suggestion is to close this bug and continue discussion on bug 747524.
Comment 14 Takao Fujiwara 2015-04-09 02:15:03 UTC
The original bug is fixed.