! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Garcon does not merge a menu when it contains DefaultLayout
Status:
RESOLVED: FIXED

Comments

Description Nick Schermer editbugs 2010-11-26 20:24:00 CET
Alacarte adds the following lines to the start of a menu:

<Menu>
	<Name>Applications</Name>
	<MergeFile type="parent">/etc/xdg/menus/applications.menu</MergeFile>
	<DefaultLayout inline="false"/>
</Menu>

The DefaultLayout node seems to prevent the MergeFile from loading, because if I remove the DefaultLayout node, the menu is properly shown in the panel.
Comment 1 Nick Schermer editbugs 2010-11-26 20:24:57 CET
Marking as a blocking bug, it might be annoying for users and probably easy to fix.
Comment 2 Jannis Pohlmann editbugs 2010-12-04 14:52:25 CET
Which version of Alacarte have you tried this with? I just tried 0.13.2 and when I e.g. move the Graphics menu into Accessories, it creates a new applications.menu but WITHOUT <DefaultLayout inline="false"/>.

It's actually Alacarte's fault. The menu specification does not allow empty <DefaultLayout> elements. It says:

  Each <Layout> or <DefaultLayout> element shall have exactly one <Merge 
  type="all"> element or it shall have exactly one <Merge type="files"> 
  and exactly one <Merge type="menus"> element. An exception is made for 
  a completely empty <Layout> element which may be used to indicate that 
  the default-layout should be used instead.

So, no empty <DefaultLayout> elements. The spec doesn't mention how multiple <DefaultLayout> elements are to be treated. Are they supposed to be merged? Are they consolidated so that only the last one survives? It's not specified. But I assume that only the last one should be used if there are more than one. In that case, an empty <DefaultLayout> in the edited menu will override the <DefaultLayout> of the original applications.menu, and the menu will be completely empty.

I can add a workaround for this by adding <Merge type="all"> to empty <DefaultLayout> elements. But I'm pretty convinced that this not a bug in garcon.
Comment 3 Jannis Pohlmann editbugs 2010-12-04 15:02:44 CET
Workaround added in master (using <Merge type="menus"/> + <Merge type="files"/>):

commit b66e39c727817d6ce6cc4de89d3caeee643008fc
Author: Jannis Pohlmann <jannis@xfce.org>
Date:   Sat Dec 4 15:00:18 2010 +0100

    Add workaround to fix empty <DefaultLayout> elements (bug #6882).
    
    For more information see my comment on the bug on
    
      http://bugzilla.xfce.org/show_bug.cgi?id=6882#c2
Comment 4 Jannis Pohlmann editbugs 2010-12-04 15:03:21 CET
Please let me know about the alacarte version and the steps to reproduce the appearance of <DefaultLayout inline="false"/>, even if this bug is now closed.

Bug #6882

Reported by:
Nick Schermer
Reported on: 2010-11-26
Last modified on: 2010-12-04

People

Assignee:
Jannis Pohlmann
CC List:
0 users

Version

Attachments

Additional information