GNOME Bugzilla – Bug 314097
Muine notification dissappears after gnome-panel crash
Last modified: 2006-05-29 22:29:47 UTC
Version details: Breezy If the gnome-panel crashes, then the notification icon doesn't reappear. I seem to recall that in the past it reappeared perfectly, but not with the current 0.8.3 release (with the associated plugin). Ubuntu/Breezy ii muine 0.8.3-5ubuntu3 Simple playlist based music player ii muine-plugin-trayicon 0.8.3-5ubuntu3 TrayIcon Plugin for the Muine music player
I'm seeing the same behaviour with Blam, so this probably isn't a bug in Muine. Reassigning to gnome-panel.
This is working fine for some apps (at least gossip). I think the applications need to correctly handle when the tray manager disappears... Or maybe it's a problem in eggtrayicon? Most probably not a problem with the panel. Reassigning back :-)
The code in muine/plugins/egg-sharp.cs is just... broken: Jorn tried to port the f.d.o tray icon spec to C# and failed (or got bored). (This is 2005-05-01, btw.) There's TODOs all over the place, in particular where the tray manager disappearing should be handled. C# is just not right for the tray icon spec. It's fairly involved Xlib logic; structures, pointers and casts all over the place. eggtrayicon.[ch] has the code correct, tested and actively maintained, so there's no point having another implementation on gnome.org. The right thing to do would be to add back eggtrayicon.[ch] (updated from latest libegg) into libmuine.so - it's only 500 lines or so, so the alternative of creating libmuine-trayicon.so just looks silly.
So it's actually tberman's fault, not Jorn's. See http://off.net/~tberman/diary/archives/003104.html for the story. (I still reckon using C# with Xlib is like using a kitten to hammer in screws...) Anyway, I've taken the time (and learning opportunity) to finish egg-sharp.cs; I've implemented the missing aspects to make it algorithmically identical to eggtrayicon.c. It now behaves when the tray manager disappears.
Created attachment 54849 [details] egg-sharp.cs
Created attachment 54853 [details] egg-sharp.cs Fixed to work on x86-64. The problem is that the Xlib long type does not directly correspong to any CLR numeric type - on x86, system long == CLR int, but on amd64, system long == CLR long. The solution I've found is to use IntPtr; don't know if there's a better fix.
Created attachment 54854 [details] [review] muine-trayicon-fix.patch ... and as a patch to the current egg-sharp.cs. Right, looks like blam and banshee both use the broken code; time to file some bugs.
blam: bug 155484 banshee: bug 321684
Created attachment 55356 [details] egg-sharp.cs Aaron pointed out that a more liberal license than the GPL could be useful. This is relicensed under the LGPL 2; I based my work on the libegg code, which is LGPL 2.
Created attachment 55357 [details] [review] muine-trayicon-fix.patch, relicensed LGPL 2
Note: causes segv under mono 1.1.11, 1.1.12 and possibly later; see http://bugzilla.ximian.com/show_bug.cgi?id=77026 for workaround.
*** Bug 330803 has been marked as a duplicate of this bug. ***
Ok, version roughly based off of Ed's version is now commited. I've confirmed on both an amd64 and x86 box that muine now recovers gracefully from a `killall gnome-panel`. Marking this FIXED, please re-open if you have any issues with this with current CVS. Thanks.