Skip to content

Commit

Permalink
#2340 try without XDG_CONFIG_DIRS if we have to
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@23019 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 22, 2019
1 parent c0c8a59 commit 663065d
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions src/xpra/platform/xposix/xdg_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,28 @@ def do_load_xdg_menu_data():
menu = None
error = None
with OSEnvContext():
#see ticket #2174,
#things may break if the prefix is not set,
#and it isn't set when logging in via ssh
for prefix in (None, "", "gnome-", "kde-"):
if prefix is not None:
os.environ["XDG_MENU_PREFIX"] = prefix
try:
menu = parse()
break
except ParsingError as e:
log("do_load_xdg_menu_data()", exc_info=True)
error = e
menu = None
#see ticket #2340,
#invalid values for XDG_CONFIG_DIRS can cause problems,
#so try unsetting it if we can't load the menus with it:
for cd in (False, True):
if cd:
try:
del os.environ["XDG_CONFIG_DIRS"]
except KeyError:
continue
#see ticket #2174,
#things may break if the prefix is not set,
#and it isn't set when logging in via ssh
for prefix in (None, "", "gnome-", "kde-"):
if prefix is not None:
os.environ["XDG_MENU_PREFIX"] = prefix
try:
menu = parse()
break
except ParsingError as e:
log("do_load_xdg_menu_data()", exc_info=True)
error = e
menu = None
if menu is None:
if error:
log.error("Error parsing xdg menu data:")
Expand Down

0 comments on commit 663065d

Please sign in to comment.