GNOME Bugzilla – Bug 449858
[patch] applications crash on fluxbox restart
Last modified: 2010-10-29 10:19:50 UTC
Steps to reproduce: 1. Run fluxbox. 2. Run a program (say, pidgin) with an eggtray icon. 3. Restart fluxbox. Stack trace:
+ Trace 142730
Other information: That backtrace is against an older version of libegg because that's what's in pidgin. The bug still exists in svn, though. I have a patch to fix this. I'll attach it as soon as bugzilla lets me.
Created attachment 90413 [details] [review] patch that fixes the problem Don't give a NULL pointer to GDK_DISPLAY_XDISPLAY, since it dereferences without checking it. I also plan to submit a bug to gtk+ about that.
thanks for submitting. see Comment #10 in the duplicate report. *** This bug has been marked as a duplicate of 302549 ***
(In reply to comment #1) > Don't give a NULL pointer to GDK_DISPLAY_XDISPLAY, since it dereferences > without checking it. I also plan to submit a bug to gtk+ about that. + display = gtk_widget_get_display (GTK_WIDGET (icon)); + g_return_if_fail (GDK_IS_DISPLAY (display)); + + xdisplay = GDK_DISPLAY_XDISPLAY (display); this should be: if (gtk_widget_has_display (GTK_WIDGET (icon)) display = gtk_wigdet_get_display (GTK_WIDGET (icon)); else display = gdk_display_get_default (); xdisplay = GDK_DISPLAY_XDISPLAY (display); in any case, eggtrayicon.c is not maintained anymore and is deprecated by GtkStatusIcon; since libegg is cut-and-paste code you're basically on your own if you want to keep using it.
Yes, I knew it was deprecated. The pidgin developers told me that. However, they're still using it to stay compatible with older versions of gtk+. Since other projects probably do the same thing, I figured the bug should be fixed at the source. As for the fix, I appreciate the comment. I've never coded anything for gtk+, so I was basically just grasping at straws for anything that worked. I'll post a reference to this in the pidgin bug.
Hmmm, that code might work better if gtk_widget_has_display() existed. Here's an update for what I'm guessing you mean: display = gtk_widget_get_display (GTK_WIDGET (icon)); if (!GDK_IS_DISPLAY (display)) display = gdk_display_get_default ();
yeah, I always mess up with gtk_widget_has_screen(). (In reply to comment #5) > display = gtk_widget_get_display (GTK_WIDGET (icon)); > if (!GDK_IS_DISPLAY (display)) > display = gdk_display_get_default (); yeah, this should be enough.
Why this patch is not yet applied? There is still many application out there using eggtray for various reason, and most of them are crashing on system tray application restart.
Because eggtrayicon is unmaintained, and should not be used anymore. It should be replaced by GtkStatusIcon whereever you encounter it. Patching the master copy in libegg will not achieve anything, since all apps still need to update their own copy, and if they do change their code they may as well just move to gtkstatusicon already.
Ok, but what I've heard from several GTK app maintainer is that they do not want to swtich to GtkStatusIcon because it's far less powerful.
(In reply to comment #9) > Ok, but what I've heard from several GTK app maintainer is that they do not > want to swtich to GtkStatusIcon because it's far less powerful. Then please tell exactly which features are missing. Things can't be improved if people don't provide patches.
So is the patch isn't going to be applied, is this a WONTFIX then?
EggTrayIcon has been remove from libegg a while ago, so I'll close this as WONTFIX. Thanks for the patch anyway. However, if GtkStatusIcon is missing something, we really need GTK+ bug reports for that.