Skip to content

Commit

Permalink
if we fail to locate the "-config" command line argument, continue wi…
Browse files Browse the repository at this point in the history
…thout uinput and log a warning

git-svn-id: https://xpra.org/svn/Xpra/trunk@17315 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 6, 2017
1 parent 4b4fb51 commit ff155d4
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/xpra/x11/vfb_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,25 +153,26 @@ def pathexpand(s):
if not xvfb_cmd:
raise InitException("cannot start Xvfb, the command definition is missing!")

cleanups = []
if uinput_uuid:
#use uinput:
#identify -config xorg.conf argument and replace it with the uinput one:
try:
config_argindex = xvfb_cmd.index("-config")
except ValueError as e:
config_argindex = -1
assert config_argindex+1<len(xvfb_cmd), "invalid xvfb command string: -config should not be last (found at index %i)" % config_argindex
xorg_conf = xvfb_cmd[config_argindex+1]
if xorg_conf.endswith("xorg.conf"):
xorg_conf = xorg_conf.replace("xorg.conf", "xorg-uinput.conf")
if os.path.exists(xorg_conf):
xvfb_cmd[config_argindex+1] = xorg_conf
#create uinput device definition files:
#(we have to assume that Xorg is configured to use this path..)
xorg_conf_dir = pathexpand(get_Xdummy_confdir())
cleanups = create_xorg_device_configs(xorg_conf_dir, uinput_uuid, uid, gid)
else:
cleanups = []
log.warn("Warning: cannot use uinput")
log.warn(" '-config' argument not found in the xvfb command")
else:
assert config_argindex+1<len(xvfb_cmd), "invalid xvfb command string: -config should not be last (found at index %i)" % config_argindex
xorg_conf = xvfb_cmd[config_argindex+1]
if xorg_conf.endswith("xorg.conf"):
xorg_conf = xorg_conf.replace("xorg.conf", "xorg-uinput.conf")
if os.path.exists(xorg_conf):
xvfb_cmd[config_argindex+1] = xorg_conf
#create uinput device definition files:
#(we have to assume that Xorg is configured to use this path..)
xorg_conf_dir = pathexpand(get_Xdummy_confdir())
cleanups = create_xorg_device_configs(xorg_conf_dir, uinput_uuid, uid, gid)

xvfb_executable = xvfb_cmd[0]
if (xvfb_executable.endswith("Xorg") or xvfb_executable.endswith("Xdummy")) and pixel_depth>0:
Expand Down

0 comments on commit ff155d4

Please sign in to comment.