Skip to content

Commit

Permalink
#172: remove displayfd option since all the distros we support have i…
Browse files Browse the repository at this point in the history
…t (also simplifies the code)

git-svn-id: https://xpra.org/svn/Xpra/trunk@13502 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 30, 2016
1 parent 974af94 commit aad5ab3
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 54 deletions.
2 changes: 1 addition & 1 deletion src/etc/xpra/conf.d/05_features.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ clipboard = yes
clipboard-direction = both

# Forward notifications:
notifications = yes
notifications = %(notifications)s

# Show Xpra's tray menu
tray = yes
Expand Down
9 changes: 4 additions & 5 deletions src/etc/xpra/conf.d/50_server_network.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Server Network Options:


# broadcast servers using mDNS:
mdns = %(mdns)s

########################################################################
# local unix domain sockets:

Expand Down Expand Up @@ -69,7 +72,7 @@ ssl = auto


########################################################################
# html / tcp-proxy and mdns:
# html / tcp-proxy:

# Where to send non xpra clients:
# (can be used to share the port with a web server)
Expand All @@ -80,7 +83,3 @@ ssl = auto
#html = yes
#html = /var/www/htdocs/
html = auto

# Publish sessions:
#mdns = no
mdns = %(mdns)s
3 changes: 0 additions & 3 deletions src/etc/xpra/conf.d/55_server_x11.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,3 @@ sync-xvfb = 0
#
# Selecting virtual X server:
xvfb = %(xvfb_command)s

# Does the xvfb command support the "-displayfd" argument?
displayfd = %(has_displayfd)s
5 changes: 1 addition & 4 deletions src/man/xpra.1
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,7 @@ display (for when xpra is talking to X applications) and as an
identifier by which xpra clients (like \fBxpra attach\fP) can locate
the xpra server.

If your \fBxvfb\fP command supports the \fB-displayfd\fP argument,
you may set the \fBdisplayfd\fP option to \fBtrue\fP in your
\fBxpra.conf\fP file
and then you may omit the display number when using \fBxpra start\fP:
You may omit the display number when using \fBxpra start\fP:
a display will be chosen for you automatically.
The display number chosen will be shown in the log output, you should
also be able to see it with \fBxpra list\fP.
Expand Down
27 changes: 8 additions & 19 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,26 +762,16 @@ def get_conf_dir(install_dir, stripbuildroot=True):
return os.path.join(*dirs)

def detect_xorg_setup(install_dir=None):
#returns (xvfb_command, has_displayfd, use_dummmy_wrapper)
#returns the xvfb command to use
if WIN32:
return ("", False, False)
return ""

from xpra.scripts.config import get_xorg_bin, get_xorg_version
xorg_bin = get_xorg_bin()

# detect displayfd support based on Xorg version
# if Xdummy support is enabled,
# then the X server is new enough to support displayfd:
if Xdummy_ENABLED is True:
has_displayfd = True
elif get_xorg_version(xorg_bin) >= [1, 13]:
has_displayfd = True
else:
has_displayfd = False

def Xvfb():
from xpra.scripts.config import get_Xvfb_command
return (get_Xvfb_command(), has_displayfd, False)
return get_Xvfb_command()

if sys.platform.find("bsd")>=0 and Xdummy_ENABLED is None:
print("Warning: sorry, no support for Xdummy on %s" % sys.platform)
Expand Down Expand Up @@ -817,7 +807,7 @@ def Xorg_suid_check():
from xpra.platform.paths import get_default_log_dir
log_dir = get_default_log_dir().replace("~/", "${HOME}/")
from xpra.scripts.config import get_Xdummy_command
return (get_Xdummy_command(use_wrapper, log_dir=log_dir, xorg_conf=xorg_conf), has_displayfd, use_wrapper)
return get_Xdummy_command(use_wrapper, log_dir=log_dir, xorg_conf=xorg_conf)

if Xdummy_ENABLED is False:
return Xvfb()
Expand All @@ -839,7 +829,7 @@ def Xorg_suid_check():
if release in ("trusty", "xenial", "yakkety", ):
#yet another instance of Ubuntu breaking something
print("Warning: Ubuntu '%s' breaks Xorg/Xdummy usage - using Xvfb fallback" % release)
return Xvfb()
return Xvfb()
else:
print("Warning: failed to detect OS release using %s: %s" % (" ".join(cmd), err))

Expand All @@ -855,7 +845,7 @@ def Xorg_suid_check():

def build_xpra_conf(install_dir):
#generates an actual config file from the template
xvfb_command, has_displayfd, _ = detect_xorg_setup(install_dir)
xvfb_command = detect_xorg_setup(install_dir)
from xpra.platform.features import DEFAULT_ENV
def bstr(b):
return ["no", "yes"][int(b)]
Expand Down Expand Up @@ -898,7 +888,6 @@ def pretty_cmd(cmd):
'key_shortcuts' : "".join(("key-shortcut = %s\n" % x) for x in get_default_key_shortcuts()),
'remote_logging' : "both",
'start_env' : start_env,
'has_displayfd' : bstr(has_displayfd),
'pulseaudio_command' : pretty_cmd(DEFAULT_PULSEAUDIO_COMMAND),
'pulseaudio_configure_commands' : "\n".join(("pulseaudio-configure-commands = %s" % pretty_cmd(x)) for x in DEFAULT_PULSEAUDIO_CONFIGURE_COMMANDS),
'conf_dir' : conf_dir,
Expand Down Expand Up @@ -1843,8 +1832,8 @@ def run(self):

if server_ENABLED and x11_ENABLED:
#install xpra_Xdummy if we need it:
_, _, use_Xdummy_wrapper = detect_xorg_setup()
if use_Xdummy_wrapper:
xvfb_command = detect_xorg_setup()
if any(x.find("xpra_Xdummy")>=0 for x in (xvfb_command or [])):
bin_dir = os.path.join(self.install_dir, "bin")
self.mkpath(bin_dir)
dummy_script = os.path.join(bin_dir, "xpra_Xdummy")
Expand Down
2 changes: 0 additions & 2 deletions src/xpra/platform/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
LOCAL_SERVERS_SUPPORTED = sys.version_info[0]<3
XDUMMY = False
XDUMMY_WRAPPER = False
DISPLAYFD = False
SHADOW_SUPPORTED = True
CAN_DAEMONIZE = True
MMAP_SUPPORTED = True
Expand Down Expand Up @@ -48,7 +47,6 @@


_features_list_ = ["LOCAL_SERVERS_SUPPORTED",
"DISPLAYFD",
"XDUMMY",
"XDUMMY_WRAPPER",
"SHADOW_SUPPORTED",
Expand Down
2 changes: 0 additions & 2 deletions src/xpra/platform/xposix/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#this is only our best guess
#there is more logic in setup.py, but it requires more effort too:
XDUMMY = not is_Ubuntu() and not sys.platform.find("bsd")>=0
#displayfd requires Xdummy, and we don't support servers with py3k:
DISPLAYFD = XDUMMY and sys.version_info[0]<3
XDUMMY_WRAPPER = is_Fedora()

DEFAULT_ENV = [
Expand Down
5 changes: 2 additions & 3 deletions src/xpra/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ def read_xpra_defaults():
#boolean options:
"daemon" : bool,
"use-display" : bool,
"displayfd" : bool,
"fake-xinerama" : bool,
"resize_display" : bool,
"tray" : bool,
Expand Down Expand Up @@ -513,7 +512,8 @@ def get_defaults():
global GLOBAL_DEFAULTS
if GLOBAL_DEFAULTS is not None:
return GLOBAL_DEFAULTS
from xpra.platform.features import DEFAULT_SSH_COMMAND, OPEN_COMMAND, DEFAULT_PULSEAUDIO_CONFIGURE_COMMANDS, DEFAULT_PULSEAUDIO_COMMAND, XDUMMY, XDUMMY_WRAPPER, DISPLAYFD, DEFAULT_ENV, CAN_DAEMONIZE
from xpra.platform.features import DEFAULT_SSH_COMMAND, OPEN_COMMAND, DEFAULT_PULSEAUDIO_CONFIGURE_COMMANDS, DEFAULT_PULSEAUDIO_COMMAND, \
XDUMMY, XDUMMY_WRAPPER, DEFAULT_ENV, CAN_DAEMONIZE
from xpra.platform.paths import get_download_dir, get_default_log_dir, get_remote_run_xpra_scripts
try:
from xpra.platform.info import get_username
Expand Down Expand Up @@ -627,7 +627,6 @@ def addtrailingslash(v):
"auto-refresh-delay": 0.15,
"daemon" : CAN_DAEMONIZE,
"use-display" : False,
"displayfd" : DISPLAYFD,
"fake-xinerama" : not OSX and not WIN32,
"resize-display" : not OSX and not WIN32,
"tray" : True,
Expand Down
20 changes: 7 additions & 13 deletions src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,8 @@ def do_parse_cmdline(cmdline, defaults):
server_modes.append("start")
server_modes.append("start-desktop")
server_modes.append("upgrade")
#display: default to required
dstr = " DISPLAY"
if defaults.displayfd:
#display argument is optional (we can use "-displayfd")
dstr = " [DISPLAY]"
command_options = ["\t%prog start"+dstr+"\n",
"\t%prog start-desktop"+dstr+"\n",
command_options = ["\t%prog start [DISPLAY]\n",
"\t%prog start-desktop [DISPLAY]\n",
"\t%prog stop [DISPLAY]\n",
"\t%prog exit [DISPLAY]\n",
"\t%prog list\n",
Expand All @@ -246,9 +241,10 @@ def do_parse_cmdline(cmdline, defaults):

parser = ModifiedOptionParser(version="xpra v%s" % XPRA_VERSION,
usage="\n" + "".join(command_options))
hidden_options = {"display" : defaults.display,
"displayfd" : defaults.displayfd,
"wm_name" : defaults.wm_name}
hidden_options = {
"display" : defaults.display,
"wm_name" : defaults.wm_name,
}
def replace_option(oldoption, newoption):
do_replace_option(cmdline, oldoption, newoption)
def legacy_bool_parse(optionname, newoptionname=None):
Expand Down Expand Up @@ -2065,8 +2061,6 @@ def run_proxy(error_cb, opts, script_file, args, mode, defaults):
if len(args)==1:
display_name = args[0]
elif len(args)==0:
if not opts.displayfd:
raise InitException("this server does not support displayfd, you must specify a DISPLAY to use")
#let the server get one from Xorg via displayfd:
display_name = 'S' + str(os.getpid())
existing_sockets = set(dotxpra.sockets(matching_state=dotxpra.LIVE))
Expand Down Expand Up @@ -2329,7 +2323,7 @@ def run_showconfig(options, args):
"exit-with-children", "start-new-commands", "start", "start-child"]
if WIN32:
#"exit-ssh"?
HIDDEN += ["lpadmin", "daemon", "use-display", "displayfd", "mmap-group", "mdns"]
HIDDEN += ["lpadmin", "daemon", "use-display", "mmap-group", "mdns"]
if not OSX:
HIDDEN += ["dock-icon", "swap-keys"]
def vstr(v):
Expand Down
2 changes: 0 additions & 2 deletions src/xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,6 @@ def run_server(error_cb, opts, mode, xpra_file, extra_args, desktop_display=None
else:
if proxying:
error_cb("you must specify a free virtual display name to use with the proxy server")
if not opts.displayfd:
error_cb("displayfd support is not enabled on this system, you must specify the display to use")
if opts.use_display:
#only use automatic guess for xpra displays and not X11 displays:
display_name = guess_xpra_display(opts.socket_dir, opts.socket_dirs)
Expand Down

0 comments on commit aad5ab3

Please sign in to comment.