[Xfce4-commits] r26505 - in xfdesktop/trunk: . modules/menu
Brian J. Tarricone
bjt23 at cornell.edu
Wed Dec 26 23:02:21 CET 2007
On Wed, 26 Dec 2007 19:30:09 +0100 Jannis Pohlmann wrote:
> Hey Brian,
>
> Am Wed, 26 Dec 2007 06:59:39 +0000 (UTC)
> schrieb "Brian Tarricone" <kelnos at xfce.org>:
>
> > Author: kelnos
> > Date: 2007-12-26 06:59:39 +0000 (Wed, 26 Dec 2007)
> > New Revision: 26505
> >
> > Modified:
> > xfdesktop/trunk/configure.ac.in
> > xfdesktop/trunk/modules/menu/desktop-menu.c
> > Log:
> > invalidate .desktop file cache when something changes, disable
> > adding per-file monitors (per-directory is enough), tho there
> > appears to be a bug in the menu directory monitor code in
> > libxfce4menu
>
> I've tested this update on my laptop and monitoring indeed does not
> seem to work.
>
> I wrote a small test program which is the same as test-display-menu.c
> from libxfce4menu/trunk/tests/ but which adds ThunarVFS support. Like
> xfdesktop it only monitors directories and rebuilds the whole menu on
> filesystem changes. Maybe you can get some inspirations from it,
> dunno. If not, I can debug xfdesktop again to see if I can find the
> problem. I don't think it's a bug in libxfce4menu, but of course I
> might be wrong.
Here's what I get on xfdesktop startup:
$ xfdesktop 2>&1 | grep -E 'desktop(-|_)menu'
DBG[desktop-menu.c:291] _generate_menu(): menu file name is /home/brian/.config/menus/xfce-applications.menu
TRACE[desktop-menu.c:173] desktop_menu_xfce_menu_monitor_directory(): exiting (/opt/xfce4-svn/share/applications), returning 0x0x100976b0
TRACE[desktop-menu.c:173] desktop_menu_xfce_menu_monitor_directory(): exiting (/usr/local/share/applications), returning 0x0x10097850
TRACE[desktop-menu.c:173] desktop_menu_xfce_menu_monitor_directory(): exiting (/usr/share/applications), returning 0x0x100974c8
TRACE[desktop-menu.c:173] desktop_menu_xfce_menu_monitor_directory(): exiting (/home/brian/.local/share/applications), returning 0x0x10097718
TRACE[desktop-menu.c:120] desktop_menu_something_changed(): entering (2,/usr/local/share/applications)
TRACE[desktop-menu.c:185] desktop_menu_xfce_menu_remove_monitor(): entering (0x0x100976b0)
TRACE[desktop-menu.c:185] desktop_menu_xfce_menu_remove_monitor(): entering (0x0x10097850)
TRACE[desktop-menu.c:185] desktop_menu_xfce_menu_remove_monitor(): entering (0x0x100974c8)
TRACE[desktop-menu.c:185] desktop_menu_xfce_menu_remove_monitor(): entering (0x0x10097718)
DBG[desktop-menu.c:291] _generate_menu(): menu file name is /home/brian/.config/menus/xfce-applications.menu
So it looks like what's happening is it's adding directory monitors for
everything, then getting a _DELETED message for
/usr/local/share/applications (which doesn't exist, weird), which
causes all the monitors to be removed. The menu gets re-generated, but
the directory monitors don't get re-added.
If I re-add the code that sets a file monitor as well as a directory
monitor, things sorta work. The same thing happens -- all the monitors
(file and dir) get added, then the 'something changed' callback gets
called, which removes all monitors. Then the menu gets regenerated,
but only the *file* monitors get re-added. The directory monitors
still don't get added.
At this point, monitoring sorta works. Changing or deleting an
existing .desktop file causes the menu to be regenerated (because the
file montior is triggered), but creating a new .desktop file doesn't
work (because the directory monitor isn't there).
Not sure where to go from here... Is there any other re-init
required? All I'm doing is (roughly):
XfceMenuItemCache *cache = xfce_menu_item_cache_get_default();
xfce_menu_item_cache_invalidate(cache);
g_object_unref(xfce_menu);
xfce_menu = xfce_menu_new(...);
-brian
More information about the Xfce4-dev
mailing list