Skip to content

Commit

Permalink
#3070 don't show the display entry on MS Windows and MacOS local shad…
Browse files Browse the repository at this point in the history
…ow (irrelevant there)

(also fixup the missing change to 'platform_name'
  • Loading branch information
totaam committed Apr 4, 2021
1 parent 76eb532 commit c282f30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions xpra/gtk_common/start_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def rb(sibling=None, label="", cb=None, tooltip_text=None):
self.display_entry.set_width_chars(10)
self.display_entry.set_placeholder_text("optional")
self.display_entry.set_max_length(10)
self.display_entry.set_tooltip_text("To use a specific X11 display number")
self.display_box.pack_start(self.display_label, True)
self.display_box.pack_start(self.display_entry, True, False)

Expand Down Expand Up @@ -230,6 +231,9 @@ def populate_menus(self):
localhost = self.localhost_btn.get_active()
if (OSX or WIN32) and localhost:
self.shadow_btn.set_active(True)
self.display_box.hide()
else:
self.display_box.show()
shadow_mode = self.shadow_btn.get_active()
seamless = self.seamless_btn.get_active()
if localhost:
Expand All @@ -238,13 +242,11 @@ def populate_menus(self):
self.address_box.show_all()
if shadow_mode:
#only option we show is the optional display input
self.display_box.show_all()
self.entry_box.hide()
self.category_box.hide()
self.command_box.hide()
self.exit_with_children_cb.hide()
else:
self.display_box.hide()
self.exit_with_children_cb.show()
if xdg and localhost:
#we have the xdg menus and the server is local, so we can use them:
Expand Down Expand Up @@ -432,10 +434,7 @@ def get_run_command(self, attach=False):
cmd.append("start-desktop")
ewc = self.exit_with_client_cb.get_active()
cmd.append("--exit-with-client=%s" % ewc)
if shadow:
display = self.display_entry.get_text()
else:
display = None
if not shadow:
ewc = self.exit_with_children_cb.get_active()
cmd.append("--exit-with-children=%s" % ewc)
if ewc:
Expand All @@ -444,7 +443,10 @@ def get_run_command(self, attach=False):
cmd.append("--start=%s" % command)
cmd.append("--attach=%s" % attach)
localhost = self.localhost_btn.get_active()
if not localhost:
display = self.display_entry.get_text().lstrip(":")
if localhost:
uri = ":"+display
else:
mode = self.mode_combo.get_active_text()
uri = "%s://" % mode.lower()
username = self.username_entry.get_text()
Expand All @@ -458,9 +460,7 @@ def get_run_command(self, attach=False):
uri += ":%s" % port
uri += "/"
if display:
uri += display.lstrip(":")
else:
uri = display
uri += display
if uri:
cmd.append(uri)
return cmd
Expand Down
2 changes: 1 addition & 1 deletion xpra/os_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def platform_release(release):
return release


def platform_name(sys_platform, release=None) -> str:
def platform_name(sys_platform=sys.platform, release=None) -> str:
if not sys_platform:
return "unknown"
PLATFORMS = {"win32" : "Microsoft Windows",
Expand Down

0 comments on commit c282f30

Please sign in to comment.