I am using Garcon from git on my Fedora 13 system. I have installed Zero Install and Wine, and as a result have wine.menu and zeroinstall.menu in /etc/xdg/menus/applications-merged /. This works fine when I load applications.menu with Garcon. But not so when I load the GNOME-supplied settings.menu. Garcon merges wine.menu and zeroinstall.menu from applications-merged, and I end up with a Wine and a Zero Install directory in the root of the loaded menu tree. This is made worse by the fact that the directories settings.menu contains are stored in their own .menu files (included with <MergeFile>) that also, with the exception of documentation.menu, merges the .menu files in applications-merged. The problem seems to be found in garcon-menu-merger.c line 443, with garcon_menu_merger_insert_default_merge_dirs, that always inserts $XDG_CONFIG_DIRS/menus/applications-merged/, no matter what menu file I am loading (provided, of course, that said menu file uses <DefaultMergeDirs>). From http://standards.freedesktop.org/menu-spec/latest/ar01s02.html: > $XDG_CONFIG_DIRS/menus/applications-merged/ > > The default merge directories included in the <DefaultMergeDirs> > element. By convention, third parties may add new <Menu> files in this > location to create their own sub-menus. > > Note that a system that uses either gnome-applications.menu or > kde-applications.menu depending on the desktop environment in use must > still use applications-merged as the default merge directory in both cases. In both of those cases, not in all cases. > Implementations may chose to use .menu files with names other than > application.menu for tasks or menus other than the main application menu. > In that case the first part of the name of the default merge directory is > derived from the name of the .menu file. That means settings-merged, *in place of* applications-merged, as far as I can tell. > For example in a system that uses a preferences.menu file to describe > an additional menu, the default merge directories included in the > <DefaultMergeDirs> element in the preferences.menu file would become > $XDG_CONFIG_DIRS/menus/preferences-merged/ *The* default merge directories. Not applications-merged at all. Besides that, Garcon is a very nice library. Good work!
This should be fixed in master (will be part of Xfce 4.8pre2). Please re-open if there still is an issue with this code. commit 6a6807b37ba4409132fa067a3f5bcfe388127b6a Author: Jannis Pohlmann <jannis@xfce.org> Date: Sat Dec 4 17:10:16 2010 +0100 Derive DefaultMergeDirs value from the menu filename (bug #6491). We now use the following algorithm to derive the directory name of the default merge dirs: - if the .menu file is "${XDG_MENU_PREFIX}applications.menu" or if the name cannot be derived (e.g. because the .menu file is called ".menu" only) we use "$XDG_CONFIG_DIRS/menus/"applications-merged" - in all other cases, we use "$XDG_CONFIG_DIRS/menus/XYZ-merged" (where the .menu file is called "XYZ.menu")