Skip to content

Work around pyXDG incorrect handling of <Merge type="all">

Reported on Launchpad at https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1833863

Patched in xubuntu-default-settings at https://github.com/Xubuntu/xubuntu-default-settings/commit/7b9ad09a7408895b76028dc110c7c7373aeabfa0


XFCE & Xubuntu use <Merge type="all" /> in their menu files, which python-xdg currently (all current versions) does not handle correctly:

https://gitlab.freedesktop.org/xdg/pyxdg/issues/12

I think the fix is as simple as

--- Menu.py.a 2019-06-23 17:44:24.992850139 +0100
+++ Menu.py.b 2019-06-23 17:44:41.052807584 +0100
@@ -997,7 +997,7 @@
                 for menuentry in menu.MenuEntries:
                     if menuentry not in tmp_e:
                         menu.Entries.append(menuentry)
- elif order[1] == "menus" or order[1] == "all":
+ if order[1] == "menus" or order[1] == "all":
                 menu.Submenus.sort()
                 for submenu in menu.Submenus:
                     if submenu.Name not in tmp_s:

But as it can also be trivially worked around by replacing <Merge type="all" /> with <Merge type="menus" /><Merge type="files" />, I wonder if this should be done in XFCE/Xubuntu?

Edited by Gaël Bonithon