Cannot change layout using applications-merged

Bug #204350 reported by Matthew L. Dailey
4
Affects Status Importance Assigned to Milestone
gnome-menus (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: gnome-menus

Files added to /etc/xdg/menus/applications-merged get properly merged when the application menu is displayed. However, if your want to change the layout of the application menu, this does not work. Since only the *last* Layout specification is used and the merge point of applications-merged (DefaultMergeDirs) is early in this file, any layouts specified in files in applications-merged are ignored.

As far as I can tell, there are two ways to fix this. One is to move the DefaultMergeDirs tag to the bottom of applications.menu. This makes sure that any other Layout section is the last. However, the fix that I feel is more in line with the freedesktop spec would be to change the Layout section in applications.menu to be a DefaultLayout section. This would use this layout unless there is any other Layout section.

I'll attach both patches to illustrate what I mean.

Please let me know if you need any other information.

Revision history for this message
Matthew L. Dailey (matthew-l-dailey) wrote :
Revision history for this message
Matthew L. Dailey (matthew-l-dailey) wrote :

Upon further investigation, changing from Layout to DefaultLayout is *not* a good solution to this. As per the spec, this attempts to change the layout of not only Applications, but all submenus, causing lots of bizarre results. I've removed this patch, as it's bogus.

So, it looks like relocating DefaultMergeDirs is the only workable solution here.

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

Thanks for the bug report. To get your fix included in Ubuntu, it would help if you tried transforming it into a debdiff (http://wiki.ubuntu.com/PackagingGuide/Recipes/Debdiff) and submit it for review (http://wiki.ubuntu.com/SponsorshipProcess). If you prefer somebody else to do that, that's fine - please just indicate if you're available to do that.

Revision history for this message
Matthew L. Dailey (matthew-l-dailey) wrote :

Per Andrew's suggestion, I have created a debdiff (attached). It looks like the "right" way to do this was as a patch in debian/patches, so this is what I did.

I'll mark as confirmed and subscribe ubuntu-main-sponsors.

Changed in gnome-menus:
status: New → Confirmed
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thanks for your work on the patch.

Changed in gnome-menus:
assignee: nobody → desktop-bugs
importance: Undecided → Low
Revision history for this message
Travis Watkins (amaranth) wrote :

You should not rely on changing the layout of an existing menu to work if you use applications-merged. There is no guarantee on the order things will be loaded from applications-merged, no guarantee it won't be overridden in applications.menu (which is what you're trying to 'fix' here), and no guarantee the user doesn't have an override.

Basically, the correct answer is not to fix all of this stuff, the correct answer in "Don't Do That". You have no reason or right to rearrange my menu from applications-merged, that is supposed to be used to add new menus for 3rd party applications (see WINE).

Revision history for this message
Sebastien Bacher (seb128) wrote :

unsubscribing the sponsor team, the change is not something correct

Revision history for this message
Matthew L. Dailey (matthew-l-dailey) wrote :

The idea here was simply to add some flexibility in an OEM-type setup. For example, we set up our linux clients with several third-party apps that we have in our own menu. We wanted to have this menu be at the top of Applications, rather than listed alphabetically. I can certainly see the potential of this being abused/misused, though. :-)

I'll mark this as invalid.

Changed in gnome-menus:
assignee: desktop-bugs → nobody
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.