GNOME Bugzilla – Bug 588255
notification area icon is not transparent
Last modified: 2011-04-30 09:45:35 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.
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 ?
Bertrand, I've seen this a couple of times. The issue seems to be similar to bug 571798.
Created attachment 138503 [details] screenshot of notification area As you can see, beagle-search has the same problem.
Yep, that's what I saw a few times. As far as I remember this happened after quitting full-screen games running under Wine.
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.
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?
Created attachment 138751 [details] perl script to produce a tray icon with black background
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.
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.
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.
After upgrading to GNOME 2.28, Banshee icon always has the grey background (attachment 145238 [details])
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.
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.
Created attachment 146866 [details] [review] Patch with --ignore-space-change flag Reran git format-patch with the --ignore-space-change flag, seems better.
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.
With the patch applied, I'm still seeing the issue described in comment 11.
Trying to create a GtkNotificationAreaBox before/instead of a X11NotificationAreaBox solves the problem for me.
(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?
The only problem there is that if you use GtkNotificationAreaBox you lose the popup dialog showing the currently playing track on mouse over.
The attached patch worked perfect for me (patched against latest git revision). Tray icon is transparent now. Thanks.
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.
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.
Created attachment 150357 [details] Screenshot showing the white bg on SLED 11 caused by the patch
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 :(
Created attachment 155287 [details] [review] Clear the eventbox background on expose event Smallest patch I could come up with to fix this.
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.
Works fine here; commit-away Alexander.
Thanks, Christian!
Committed, thanks everyone!
Review of attachment 155287 [details] [review]: It is working fine applied to banshee 1.5.4 on Mandriva Cooker.
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.
I've reverted the patch; reopening.
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
The committed patch worked for me in Fedora 12 with GNOME.
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.
Ooops! I'll take another look. Paul's patch doesn't work for me either.
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?
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.
Created attachment 156840 [details] Notification area icon not transparent.
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.
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)
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)
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.
(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.
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.
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
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).
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?
Tried replacing, but that didn't work. 1.7.0 looks exactly the same :-(
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
*** Bug 621372 has been marked as a duplicate of this bug. ***
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.
This last patch works for me.
Review of attachment 164158 [details] [review]: Works for me too!
It's fixed!
(In reply to comment #54) > Review of attachment 164158 [details] [review]: > > Works for me too! Same here. ;-)
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.
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.
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?
Just as an additional data point, I'm seeing this in GNOME Shell on the Fedora 15 beta as well.
(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.
Created attachment 186925 [details] Banshee icon in Gnome Shell (Fedora 15 Beta)
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 ;)