Browse Source

Properly handle OnlyShowIn and NotShowIn.

OnlyShowIn and NotShowIn relate to a "real" desktop, not a window manager.

For instance if the DE is LXDE and OnlyShowIn=LXDE; the desktop entry
should be included it the menu, even if a WM like FVWM is used.
pull/10/head
didier@slint.fr 8 years ago
parent
commit
0411b5f117
  1. 11
      src/xdgmenumaker

11
src/xdgmenumaker

@ -380,12 +380,11 @@ def get_entry_info(desktopfile, ico_paths=True):
notshowin = de.getNotShowIn() notshowin = de.getNotShowIn()
hidden = de.getHidden() hidden = de.getHidden()
nodisplay = de.getNoDisplay() nodisplay = de.getNoDisplay()
# none of the freedesktop registered environments are supported by if 'XDG_CURRENT_DESKTOP' in os.environ and len(onlyshowin) >0 and not os.environ['XDG_CURRENT_DESKTOP'] in onlyshowin:
# OnlyShowIn anyway: return None
# http://standards.freedesktop.org/menu-spec/latest/apb.html if 'XDG_CURRENT_DESKTOP' in os.environ and len(notshowin) >0 and os.environ['XDG_CURRENT_DESKTOP'] in notshowin:
# So if OnlyShowIn is set, it certainly isn't for any of the WMs return None
# xdgmenumaker supports. if hidden or nodisplay:
if (onlyshowin != []) or (desktop in notshowin) or hidden or nodisplay:
return None return None
name = de.getName().encode('utf-8') name = de.getName().encode('utf-8')

Loading…
Cancel
Save