[Xfce4-commits] r27912 - xfdesktop/trunk/modules/menu

Brian J. Tarricone bjt23 at cornell.edu
Sat Sep 20 21:38:08 CEST 2008



On Sat, 20 Sep 2008 12:32:13 +0200 Jannis Pohlmann wrote:

> Am Sat, 20 Sep 2008 05:43:26 +0000 (UTC)
> schrieb "Brian Tarricone" <kelnos at xfce.org>:
> 
> > Author: kelnos
> > Date: 2008-09-20 05:43:26 +0000 (Sat, 20 Sep 2008)
> > New Revision: 27912
> > 
> > Modified:
> >    xfdesktop/trunk/modules/menu/desktop-menu.c
> > Log:
> > fix menu module crash on .desktop file change or icon theme change
> > (bug 3615)
> > 
> > this also fixes the weird "double menu" problem (bug 4342).  what
> > was happening was that thunar-vfs was firing off a dir change
> > notification, and then the menu would start to regenerate.  then it
> > would call into GtkIconTheme, which then noticed that the icon cache
> > was stale and needed to be re-read.  so then it would fire
> > GtkIconTheme::changed, which causes a recursive menu regeneration.
> > since the menu generation function isn't reentrant, now we use
> > g_idle_add() to schedule a menu regen, and we don't schedule one if
> > there's one already scheduled or in progress.
> 
> Awesome! You just fixed our number one bug. I tested it and it seems
> to work fine. No crashes, warnings or whatsoever. 

Hooray!  Totally have valgrind to thank for this one.  I did end up
writing my little test app that did nothing but create a window with a
button that uses xfdesktop's menu module to pop up the menu.  Valgrind
gave me an awesome log that had a single stack trace with two
_generate_menu() calls on the stack, with thunar-vfs at the bottom and
GtkIconTheme in the middle.  I guess I must have missed that before in
the noise when running all of xfdesktop through it.

Anyhow, glad it works for more than just me.  For reference, if anyone
needs a quick xfdesktop menu module tester, it's here:
http://mocha.xfce.org/~kelnos/xfce4/files/desktop-menu-module-test.c

	-b



More information about the Xfce4-dev mailing list