Skip to content

Commit

Permalink
make it possible to start the proxy server without specifying a displ…
Browse files Browse the repository at this point in the history
…ay: we just try to find a free one

git-svn-id: https://xpra.org/svn/Xpra/trunk@13574 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 6, 2016
1 parent d100ca6 commit 4026441
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,20 @@ def run_server(error_cb, opts, mode, xpra_file, extra_args, desktop_display=None
display_name_check(display_name)
else:
if proxying:
error_cb("you must specify a free virtual display name to use with the proxy server")
if opts.use_display:
#find a free display number:
dotxpra = DotXpra(opts.socket_dir, opts.socket_dirs)
all_displays = dotxpra.sockets()
#ie: [("LIVE", ":100"), ("LIVE", ":200"), ...]
displays = [v[1] for v in all_displays]
display_name = None
for x in range(1000, 20000):
v = ":%s" % x
if v not in displays:
display_name = v
break
if not display_name:
error_cb("you must specify a free virtual display name to use with the proxy server")
elif 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)
else:
Expand Down
4 changes: 4 additions & 0 deletions src/xpra/server/proxy/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ def init_components(self, opts):
pass


def print_screen_info(self):
#no screen, we just use a virtual display number
pass

def get_server_mode(self):
return "proxy"

Expand Down

0 comments on commit 4026441

Please sign in to comment.