Skip to content

Commit

Permalink
#1861: make display mixin optional, fix small mixin dependency issues…
Browse files Browse the repository at this point in the history
… (stream compressors are needed globally, tray tweaks)

git-svn-id: https://xpra.org/svn/Xpra/trunk@19889 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 9, 2018
1 parent 5a090ba commit 503efad
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
2 changes: 2 additions & 0 deletions src/xpra/client/client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def defaults_init(self):
self.encryption_keyfile = None
self.server_padding_options = [DEFAULT_PADDING]
self.server_client_shutdown = True
self.server_compressors = []
#protocol stuff:
self._protocol = None
self._priority_packets = []
Expand Down Expand Up @@ -974,6 +975,7 @@ def parse_server_capabilities(self):
if not c.parse_server_capabilities(self):
return False
self.server_client_shutdown = self.server_capabilities.boolget("client-shutdown", True)
self.server_compressors = self.server_capabilities.strlistget("compressors", ["zlib"])
return True

def parse_network_capabilities(self):
Expand Down
29 changes: 17 additions & 12 deletions src/xpra/client/gtk_base/gtk_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ def __init__(self):
self._ref_to_group_leader = {}
self._group_leader_wids = {}
self._set_window_menu = get_menu_support_function()
self.connect("scaling-changed", self.reset_windows_cursors)
try:
self.connect("scaling-changed", self.reset_windows_cursors)
except TypeError:
log("no 'scaling-changed' signal")
#detect when the UI thread isn't responding:
self.UI_watcher = None
self.connect("first-ui-received", self.start_UI_watcher)
Expand Down Expand Up @@ -851,18 +854,20 @@ def make_cursor(self, cursor_data):

def process_ui_capabilities(self):
UIXpraClient.process_ui_capabilities(self)
if self.server_randr:
display = display_get_default()
if is_gtk3():
#always one screen per display:
screen = gdk.Screen.get_default()
#this requires the "DisplayClient" mixin:
if not hasattr(self, "screen_size_changed"):
return
display = display_get_default()
if is_gtk3():
#always one screen per display:
screen = gdk.Screen.get_default()
screen.connect("size-changed", self.screen_size_changed)
else:
i=0
while i<display.get_n_screens():
screen = display.get_screen(i)
screen.connect("size-changed", self.screen_size_changed)
else:
i=0
while i<display.get_n_screens():
screen = display.get_screen(i)
screen.connect("size-changed", self.screen_size_changed)
i += 1
i += 1


def window_grab(self, window):
Expand Down
6 changes: 3 additions & 3 deletions src/xpra/client/gtk_base/gtk_tray_menu_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def set_menu_title(*_args):

menu.append(self.make_infomenuitem())
menu.append(self.make_featuresmenuitem())
if self.client.keyboard_helper:
if mixin_features.windows and self.client.keyboard_helper:
menu.append(self.make_layoutsmenuitem())
if mixin_features.clipboard and SHOW_CLIPBOARD_MENU:
menu.append(self.make_clipboardmenuitem())
Expand Down Expand Up @@ -411,8 +411,8 @@ def make_featuresmenuitem(self):
def append_featuresmenuitems(self, menu):
menu.append(self.make_sharingmenuitem())
menu.append(self.make_lockmenuitem())
menu.append(self.make_readonlymenuitem())
if mixin_features.windows:
menu.append(self.make_readonlymenuitem())
menu.append(self.make_bellmenuitem())
if mixin_features.notifications:
menu.append(self.make_notificationsmenuitem())
Expand All @@ -422,7 +422,7 @@ def append_featuresmenuitems(self, menu):
menu.append(self.make_openglmenuitem())
if mixin_features.windows:
menu.append(self.make_modalwindowmenuitem())
if self.client.keyboard_helper:
if mixin_features.windows and self.client.keyboard_helper:
menu.append(self.make_keyboardsyncmenuitem())

def make_sharingmenuitem(self):
Expand Down
7 changes: 5 additions & 2 deletions src/xpra/client/gtk_base/server_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ def populate_table(self):
if returncode is not None:
rstr = "%s" % returncode
#find the windows matching this pid
windows = tuple(w for w in self.client._id_to_window.values() if getattr(w, "_metadata", {}).get("pid")==pid)
log("windows matching pid=%i: %s", pid, windows)
windows = ()
from xpra.client import mixin_features
if mixin_features.windows:
windows = tuple(w for w in self.client._id_to_window.values() if getattr(w, "_metadata", {}).get("pid")==pid)
log("windows matching pid=%i: %s", pid, windows)
icon = gtk.Label()
if windows:
try:
Expand Down
2 changes: 0 additions & 2 deletions src/xpra/client/mixins/encodings.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def __init__(self):
self.server_encodings_with_quality = ()
self.server_encodings_with_lossless_mode = ()
self.server_auto_video_encoding = False
self.server_compressors = []

#what we told the server about our encoding defaults:
self.encoding_defaults = {}
Expand Down Expand Up @@ -100,7 +99,6 @@ def get_caps(self):

def parse_server_capabilities(self):
c = self.server_capabilities
self.server_compressors = c.strlistget("compressors", ["zlib"])
self.server_encodings = c.strlistget("encodings")
self.server_core_encodings = c.strlistget("encodings.core", self.server_encodings)
self.server_encodings_problematic = c.strlistget("encodings.problematic", PROBLEMATIC_ENCODINGS) #server is telling us to try to avoid those
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ def impcheck(*modules):
return False
return True
from xpra.client import mixin_features
mixin_features.display = True
mixin_features.display = opts.windows
mixin_features.windows = opts.windows
mixin_features.audio = (b(opts.speaker) or b(opts.microphone)) and impcheck("sound")
mixin_features.webcam = b(opts.webcam) and impcheck("codecs")
Expand Down

0 comments on commit 503efad

Please sign in to comment.