Red Hat Bugzilla – Bug 168304
3rd party application shows up in multiple menus
Last modified: 2012-06-20 11:53:30 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050910 CentOS/1.0.6-1.4.2.centos4 Firefox/1.0.6
Description of problem:
Using kde (3.3.1)
According to http://standards.freedesktop.org/menu-spec/menu-spec-latest.html I should be putting my ".menu" files in /etc/xdg/menus/applications-merged. My menu file is at the bottom of the message. According to the spec the line <DefaultMergeDirs/> in applications.menu is reading in my menu. This is working as expected. The problem is that it is also showing up under the "Preferences", "System Settings", and "System Settings -> Server Settings" menu.
The reason this is happening for the "Preferences" menu is that applications.menu is doing a <MergeFile>preferences.menu</MergeFile> and in preferences.menu it is calling <DefaultMergeDirs/>. The <DefaultMergeDirs/> in the preferences.menu is causing it to appear in the preferences menu.
For the "System Settings" menu the same thing is happening but with the file system-settings.menu. For "Systems Settings -> Server Settings", system-settings.menu is calling <MergeFile>server-settings.menu</MergeFile> and server-settings.menu is again calling <DefaultMergeDirs/>.
A fix would be to remove the calls to <DefaultMergeDirs/> from preferences.menu, system-settings.menu, and server-settings.menu. Should the calls to <LegacyDir>, <DefaultAppDirs/>, and <DefaultDirectoryDirs/> be removed for the same reason?
The following files have been modified to work as a standalone example
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
My Rush.directory (/usr/local/rush/etc/desktop/directories/Rush.directory):
Comment=Rush Render Queue
And one of my .desktop (/usr/local/rush/etc/desktop/applications/irush.desktop) files is:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Read the above desription
Actual Results: My application appeared in the "Preferences", "System Settings", and "System Settings -> Server Settings" menu.
Expected Results: It should have not been in the menus.
After reading some more bugs this is related to
It seems they came too the same conclusion that removing <DefaultMergeDirs/>,
<LegacyDir>, <DefaultAppDirs/>, and <DefaultDirectoryDirs/> from
preferences.menu, system-settings.menu, and server-settings.menu.
Also related to https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=141514
Sorry for all the comments. Reading thru
http://standards.freedesktop.org/menu-spec/menu-spec-latest.html again it seems
like this could be a bug in how <MergeFile> is handled. It is not quite clear
in the spec if <DefaultMergeDirs> should still be looking at applications-merged
or preferences-merged (system-settings-merged server-settings-merged). The
behavior right now is to look in applications-merged but it would be much more
powerful to look at "menu-file-basename"-merged.
From the other bugs referenced it is correct that preferences, system-settings,
and server-settings should not be calling
<LegacyDir>/etc/X11/applnk</LegacyDir>. It is ok that preferences is calling
<LegacyDir>/usr/share/gnome/capplets/</LegacyDir> since they are specific to
BTW, the parsing of this menu files is in
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life.
Please See https://access.redhat.com/support/policy/updates/errata/
If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.