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 588255 - notification area icon is not transparent
notification area icon is not transparent
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: User Interface
1.5.0
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 621372 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-07-10 15:40 UTC by Götz Waschk
Modified: 2011-04-30 09:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of notification area (5.80 KB, image/png)
2009-07-16 06:33 UTC, Götz Waschk
  Details
perl script to produce a tray icon with black background (398 bytes, text/plain)
2009-07-19 19:27 UTC, Hernando Torque
  Details
Setup X11NotificationArea visual & colormap (33.71 KB, patch)
2009-11-03 17:32 UTC, Paul Burton
needs-work Details | Review
Patch with --ignore-space-change flag (9.67 KB, patch)
2009-11-03 18:57 UTC, Paul Burton
none Details | Review
Patch completely reindented (8.60 KB, patch)
2009-11-07 16:44 UTC, Chow Loong Jin
needs-work Details | Review
Screenshot showing the white bg on SLED 11 caused by the patch (2.30 KB, image/png)
2009-12-24 19:22 UTC, Gabriel Burt
  Details
Screenshot on gnome-shell (1.96 KB, image/png)
2010-02-19 18:26 UTC, Michael Monreal
  Details
Clear the eventbox background on expose event (1.73 KB, patch)
2010-03-05 07:02 UTC, Christian Hergert
committed Details | Review
updated verision of Paul's patch, just fixing formatting (8.32 KB, patch)
2010-03-07 00:37 UTC, Gabriel Burt
none Details | Review
Notification area icon not transparent. (21.23 KB, image/png)
2010-03-23 09:34 UTC, skalka
  Details
Banshee's icon with elementary-remix theme (40.32 KB, image/png)
2010-04-04 07:42 UTC, Chow Loong Jin
  Details
Banshee icon on Ubuntu 10.04 (5.97 KB, image/png)
2010-05-02 11:14 UTC, Mateusz Barucha
  Details
Fix icon transparency on recent GTK+ (8.29 KB, patch)
2010-06-20 18:48 UTC, Bertrand Lorentz
committed Details | Review
Banshee icon in Gnome Shell (Fedora 15 Beta) (5.42 KB, image/png)
2011-04-30 09:15 UTC, Benjamín Valero Espinosa
  Details

Description Götz Waschk 2009-07-10 15:40:11 UTC
This is on Mandriva Cooker with banshee 1.5.0 and Gnome 2.27. The banshee icon in the notification area is not transparent but has a black background.

I'm using gnome-panel 2.26.3, gtk-sharp 2.12.9, and gtk+ 2.17.3. 

Other icons are transparent, e.g. the one from pidgin.
Comment 1 Bertrand Lorentz 2009-07-15 19:08:38 UTC
I don't see this problem with banshee 1.5.0 and gnome 2.26.2.

Could you attach a screenshot that shows the problem ?
Comment 2 Alexander Kojevnikov 2009-07-15 19:30:16 UTC
Bertrand, I've seen this a couple of times. The issue seems to be similar to bug 571798.
Comment 3 Götz Waschk 2009-07-16 06:33:13 UTC
Created attachment 138503 [details]
screenshot of notification area

As you can see, beagle-search has the same problem.
Comment 4 Alexander Kojevnikov 2009-07-16 07:30:20 UTC
Yep, that's what I saw a few times. As far as I remember this happened after quitting full-screen games running under Wine.
Comment 5 Michael Martin-Smucker 2009-07-19 19:09:55 UTC
I could be way off on this one, but Banshee and Beagle are both Mono apps, right?  Have you seen this behavior with other Mono apps with notification icons (like Tomboy or Gnome-Do)?  Or maybe the Mono thing is completely irrelevant.
Comment 6 Hernando Torque 2009-07-19 19:26:59 UTC
Happens on an up-to-date Ubuntu 9.10 system with Gnome 2.27.4 and GTK+ 2.17.4.

Attached a simple perl script that produces a tray icon with black background (needs libgtk2-trayicon-perl, adapt icon URL if necessary).

This did not happen with Ubuntu 9.04 so I guess this is more likely GTK related?
Comment 7 Hernando Torque 2009-07-19 19:27:46 UTC
Created attachment 138751 [details]
perl script to produce a tray icon with black background
Comment 8 Hernando Torque 2009-07-19 20:56:49 UTC
Oh dear, seems the right way is to use GtkStatusIcon instead of TrayIcon. That fixed the black background in my perl example. 

Sorry for adding noise.
Comment 9 Bertrand Lorentz 2009-07-19 21:30:35 UTC
I'm wondering if using Gtk.StatusIcon would fix this.
It would mean that the proper fix for bug 529023 would also fix this one.
Comment 10 Michael Kuhn 2009-07-24 21:48:26 UTC
I am pretty sure using a GtkStatusIcon would fix this. Liferea 1.6's icon also has this issue. After backporting a fix from trunk to use a GtkStatusIcon the problem is gone.
Comment 11 Alexander Kojevnikov 2009-10-11 05:55:32 UTC
After upgrading to GNOME 2.28, Banshee icon always has the grey background (attachment 145238 [details])
Comment 12 Paul Burton 2009-11-03 17:32:39 UTC
Created attachment 146853 [details] [review]
Setup X11NotificationArea visual & colormap

This patch based on GTK's gtktrayicon-x11.c fixes the bug for me. It sets up the visual and colormap of the widget, and modifies the expose event to work as GtkTrayIcon does (i.e differently when an ARGB visual/colormap is available).

I'm also not sure if I've handled creating the patch correctly, as it seems to contain a lot of lines I didn't (intentionally at least) touch.
Comment 13 Bertrand Lorentz 2009-11-03 18:43:54 UTC
Review of attachment 146853 [details] [review]:

All those extra lines are whitespace changes :
X11NotificationArea.cs doesn't follow the HACKING guidelines, as it's indented with tabs. Your patch changes these tabs into 4 spaces.

Could you provide a patch without the whitespace changes ?
With them, it's really hard to figure out what are the actual changes.
Comment 14 Paul Burton 2009-11-03 18:57:47 UTC
Created attachment 146866 [details] [review]
Patch with --ignore-space-change flag

Reran git format-patch with the --ignore-space-change flag, seems better.
Comment 15 Chow Loong Jin 2009-11-07 16:44:06 UTC
Created attachment 147170 [details] [review]
Patch completely reindented

Applied patch, reindented the file completely from 4-spaces to tabs (some sed magic here) and then ran git diff -w to generate a patch without spaces, and re-patched the file to get rid of all whitespace changes. 

@Paul Burton, please follow the indentation of the file you are editing next time -- check if spaces or tabs are used and set your editor accordingly.
Comment 16 Alexander Kojevnikov 2009-11-11 06:32:56 UTC
With the patch applied, I'm still seeing the issue described in comment 11.
Comment 17 Tim Koopman 2009-11-16 16:23:42 UTC
Trying to create a GtkNotificationAreaBox before/instead of a X11NotificationAreaBox solves the problem for me.
Comment 18 Christian Krause 2009-11-20 21:09:58 UTC
(In reply to comment #17)
> Trying to create a GtkNotificationAreaBox before/instead of a
> X11NotificationAreaBox solves the problem for me.

Sounds good - do you have a patch to try?
Comment 19 Paul Burton 2009-11-20 21:11:22 UTC
The only problem there is that if you use GtkNotificationAreaBox you lose the popup dialog showing the currently playing track on mouse over.
Comment 20 Pavel Nazarov 2009-12-06 09:18:31 UTC
The attached patch worked perfect for me (patched against latest git revision). Tray icon is transparent now. Thanks.
Comment 21 Leonardo Amaral 2009-12-11 18:20:04 UTC
I have this problem using banshee from Ubuntu banshee ppa.

leleobhz@luana:~$ LANG=C aptitude show banshee
Package: banshee
State: installed
Automatically installed: no
Version: 1.5.3+git20091206.r1.b171cd3-0ubuntu2

Mine systray appears with "b" rounded by a gray box.
Comment 22 Gabriel Burt 2009-12-24 19:21:06 UTC
Review of attachment 147170 [details] [review]:

The patch still has bad indentation problems.  Also, it makes my previously-working icon on SLED 11 have a white background.
Comment 23 Gabriel Burt 2009-12-24 19:22:01 UTC
Created attachment 150357 [details]
Screenshot showing the white bg on SLED 11 caused by the patch
Comment 24 Michael Monreal 2010-02-19 18:26:40 UTC
Created attachment 154231 [details]
Screenshot on gnome-shell

The tray icon background also looks bad on gnome-shell (see screenshot). AFAICS banshee is the only app I use which has this problem :(
Comment 25 Christian Hergert 2010-03-05 07:02:49 UTC
Created attachment 155287 [details] [review]
Clear the eventbox background on expose event

Smallest patch I could come up with to fix this.
Comment 26 Alexander Kojevnikov 2010-03-05 07:20:50 UTC
Review of attachment 155287 [details] [review]:

Works here, thanks! I will commit it after a few more people confirm it fixes the issue for them.
Comment 27 Gabriel Burt 2010-03-05 07:26:08 UTC
Works fine here; commit-away Alexander.
Comment 28 Gabriel Burt 2010-03-05 07:26:23 UTC
Thanks, Christian!
Comment 29 Alexander Kojevnikov 2010-03-05 07:33:11 UTC
Committed, thanks everyone!
Comment 30 Götz Waschk 2010-03-05 09:27:11 UTC
Review of attachment 155287 [details] [review]:

It is working fine applied to banshee 1.5.4 on Mandriva Cooker.
Comment 31 Chow Loong Jin 2010-03-06 21:12:10 UTC
The patch does not work fine. What is happening now is that Banshee is using the GtkNotificationAreaBox fallback instead of X11NotificationAreaBox because the constructor of X11NotificationAreaBox is throwing an exception due to event_box.GdkWindow being null. The faulty line is line 89:
event_box.GdkWindow.SetBackPixmap(null, true);

event_box.GdkWindow is null because, as mentioned on http://library.gnome.org/devel/gtk/unstable/GtkWidget.html#gtk-widget-get-window, it "Returns the widget's window if it is realized, NULL otherwise", and the EventBox has not been realized yet in the constructor.
Comment 32 Gabriel Burt 2010-03-06 21:50:23 UTC
I've reverted the patch; reopening.
Comment 33 Gabriel Burt 2010-03-07 00:37:17 UTC
Created attachment 155453 [details] [review]
updated verision of Paul's patch, just fixing formatting

still breaks the transparent bg on SLED 11 for me, though
Comment 34 Benjamín Valero Espinosa 2010-03-07 09:35:19 UTC
The committed patch worked for me in Fedora 12 with GNOME.
Comment 35 Chow Loong Jin 2010-03-07 09:42:32 UTC
That's because it caused errors and forced the fallback, GtkNotificationAreaBox, to be used instead. This results in the loss of a few features, detailed in comment #19, as well as the scroll/middle click interaction with the notification area icon.
Comment 36 Christian Hergert 2010-03-11 03:03:28 UTC
Ooops!  I'll take another look.  Paul's patch doesn't work for me either.
Comment 37 Gabriel Burt 2010-03-12 23:34:11 UTC
Ugh, thinking more about this bug and how it affects (or used to) tons of other apps, it really seems like it's a bug in the panel or notification-area, no?
Comment 38 Christian Hergert 2010-03-12 23:39:54 UTC
It looks like Paul's patch is headed in the right direction (basically implementing the rest of gtk/trayicon-x11.c).  However, there are some methods that don't seem to be getting called AFAICT.
Comment 39 skalka 2010-03-23 09:34:50 UTC
Created attachment 156840 [details]
Notification area icon not transparent.
Comment 40 skalka 2010-03-23 09:36:11 UTC
Notification area icon is not transparent on a fully updated Lucid, with Banshee 1.5.5. I've tried both two new themes (Ambiance and Radiance). I attached a screenshot with pidgin icon too because in Karmic Pidgin has this issue but it works fine on Lucid. It seems that it happens only when panel has an image background or a custom color different from the default one.
Comment 41 FelipeDarder 2010-04-04 00:40:37 UTC
The icon background is always matching the system colors. 
So it does not matter if you change the panel background preferences color, transparent-opaque or image, it always match the appearance preferences.

@ Banshee 1.5.6 (gnome 2.28.2 and 2.30)
Comment 42 FelipeDarder 2010-04-04 00:50:14 UTC
The icon background color is the same as the window background color on the system>preferences>appearance, while it should match the panel>properties background settings.

(i think i was not very clear before)
Comment 43 Chow Loong Jin 2010-04-04 07:42:29 UTC
Created attachment 157857 [details]
Banshee's icon with elementary-remix theme

I actually think this is an issue between the theme/theme engine/gnome-panel. Testing with a theme that uses the Murrine engine from git, "elementary-remix" found at http://gnome-look.org/content/show.php/Elementary+remix?content=110612, and then expanding the panel to 36px so the background tiles, Banshee seems to have a perfectly transparent icon, as shown in this attachment.
Comment 44 Christian Hergert 2010-04-04 08:19:13 UTC
(In reply to comment #43)
> I actually think this is an issue between the theme/theme engine/gnome-panel.
> Testing with a theme that uses the Murrine engine from git, "elementary-remix"
> found at
> http://gnome-look.org/content/show.php/Elementary+remix?content=110612, and
> then expanding the panel to 36px so the background tiles, Banshee seems to have
> a perfectly transparent icon, as shown in this attachment.

That is because Murrine uses RGBA by default.
Comment 45 Chow Loong Jin 2010-04-04 08:46:32 UTC
What about people using Banshee in KDE, XFCE, LXDE and others? I haven't heard about this issue from them. This seems to be a gnome-panel exclusive issue, and in the first place, I remember a time when everything worked just fine. Then something changed somewhere and every application has notification area icons broke.
Comment 46 Alexander Kojevnikov 2010-04-05 03:43:28 UTC
Just want to write a summary of what we already know, going through all 45 comments can be tedious.

It appears the GtkTrayIcon has the same problem, this can be verified with the Perl script from attachment 138751 [details]. I also checked Pidgin which has the same problem and it looks like it uses an icon very similar to GtkTrayIcon [1]

This means that porting the current version of gtktrayicon-x11.c to X11NotificationArea (as attempted in patch 155453) is probably useless.

Which leaves us with three options:

 * Fix gnome-panel and/or GtkTrayIcon. Something changed between GNOME 2.26 and 2.28, the bug wasn't there in 2.26.

 * Find a workaround in our implementation of X11NotificationArea[Box].

 * Use GtkStatusIcon. Gtk# doesn't expose most events [2], we will probably need to call Gtk+ directly [3].

[1] http://developer.pidgin.im/viewmtn/revision/file/3675047f72f66174d95018d40a0100ea0bc87f8c/pidgin/eggtrayicon.c
[2] http://www.go-mono.com/docs/index.aspx?link=T:Gtk.StatusIcon/E
[3] http://library.gnome.org/devel/gtk/stable/GtkStatusIcon.html
Comment 47 Chow Loong Jin 2010-04-25 06:28:55 UTC
Does Gtk.StatusIcon in gtk-sharp-beans ship the appropriate events? If so, perhaps one solution is to rip that class out of gtk-sharp-beans and ship it (optionally using gtk-sharp-beans if it is installed on the system).
Comment 48 Mateusz Barucha 2010-05-02 11:14:04 UTC
Created attachment 160130 [details]
Banshee icon on Ubuntu 10.04

I don't know if it's the same bug, but I haven't seen this in any previously attached screenshots.

As a workaround, can I replace the icon with the correct gimp-made one? What is the path?
Comment 49 Mateusz Barucha 2010-05-11 21:42:25 UTC
Tried replacing, but that didn't work. 1.7.0 looks exactly the same :-(
Comment 50 martincasc 2010-05-31 01:23:34 UTC
In Ubuntu 10.04 with Banshee 1.7.1 the background of the icon is white... The icon has a transparent background because in Ubuntu Mono icon set. But this icon it's shown with a white background
Comment 51 Michael Martin-Smucker 2010-06-12 13:16:27 UTC
*** Bug 621372 has been marked as a duplicate of this bug. ***
Comment 52 Bertrand Lorentz 2010-06-20 18:48:02 UTC
Created attachment 164158 [details] [review]
Fix icon transparency on recent GTK+

Like the patch from Paul Burton, this patch is mostly a transposition of the following change in
GTK+ to our X11NotificationArea implementation :
http://git.gnome.org/browse/gtk+/commit/?id=783c7932f38e5690b8b5f98313f301b0f18b09c3

There are a few differences with Paul's patch, so I have good hope this will also work on older distro. Testing is very welcome !

You'll need the latest git master for the patch to apply, as I've just fixed the indentation in that file.
Comment 53 Benjamín Valero Espinosa 2010-06-20 21:04:14 UTC
This last patch works for me.
Comment 54 Alexander Kojevnikov 2010-06-21 01:44:04 UTC
Review of attachment 164158 [details] [review]:

Works for me too!
Comment 55 Chow Loong Jin 2010-06-21 08:06:27 UTC
It's fixed!
Comment 56 Christian Krause 2010-06-26 21:16:26 UTC
(In reply to comment #54)
> Review of attachment 164158 [details] [review]:
> 
> Works for me too!

Same here. ;-)
Comment 57 Chow Loong Jin 2010-06-30 19:09:59 UTC
I've already reported my findings on IRC, but I'm posting it here as well so it doesn't get lost.

I've tested this on Ubuntu Karmic using the default Ubuntu theme and the elementary theme (which uses the Murrine engine from git). My findings are:

With the default Ubuntu theme on Karmic (Human something or other, I think), Banshee's notification area icon does not have a transparent background with or without the patch.

With the elementary theme, Banshee's notification area icon has a transparent background with and without the patch.

Conclusion: patch has no effect on Ubuntu Karmic (and possibly earlier versions), i.e. no known regressions on old code so far.
Comment 58 Bertrand Lorentz 2010-08-09 21:30:02 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Due to popular demand, and after some time without any negative feedback, I've committed my patch. Let's hope we don't have to revert this one.
Comment 59 FelipeDarder 2011-04-29 22:46:05 UTC
I just installed a fresh natty, banshee 2.0.0 and gnome3/shell from ppa. The notification icon has the same problem has on the 3rd comment (solid black background). Should I open a new bug report for 2.0?
Comment 60 Theodore Lee 2011-04-30 00:09:00 UTC
Just as an additional data point, I'm seeing this in GNOME Shell on the Fedora 15 beta as well.
Comment 61 Benjamín Valero Espinosa 2011-04-30 09:15:03 UTC
(In reply to comment #60)
> Just as an additional data point, I'm seeing this in GNOME Shell on the Fedora
> 15 beta as well.

I see it too in Fedora 15 Beta.

I am reopening this bug. I hope this can be solved in a general way.
Comment 62 Benjamín Valero Espinosa 2011-04-30 09:15:48 UTC
Created attachment 186925 [details]
Banshee icon in Gnome Shell (Fedora 15 Beta)
Comment 63 Bertrand Lorentz 2011-04-30 09:45:35 UTC
For everyone experiencing this issue with a recent Banshee version (1.9.x and above) :

This is a regression caused by a workaround for a bad crash. So although the symptoms are the same, it is a different issue. It is tracked in bug #645832.

Please subscribe there to be notified of any progress.

You can also try the temporary fix indicated in the first comment on bug #645832.

I'm closing this bug again. Please allow it to rest in peace, it already had a long and complicated life ;)