diff --git a/src/xpra/client/gtk_base/gtk_client_base.py b/src/xpra/client/gtk_base/gtk_client_base.py index 3a44c0c8da..42bbd40dec 100644 --- a/src/xpra/client/gtk_base/gtk_client_base.py +++ b/src/xpra/client/gtk_base/gtk_client_base.py @@ -44,6 +44,7 @@ get_default_root_window, get_root_size, get_xwindow, image_new_from_stock, \ INTERP_BILINEAR, WINDOW_TOPLEVEL, DIALOG_MODAL, DESTROY_WITH_PARENT, MESSAGE_INFO, BUTTONS_CLOSE, ICON_SIZE_BUTTON, GRAB_STATUS_STRING, \ BUTTON_PRESS_MASK, BUTTON_RELEASE_MASK, POINTER_MOTION_MASK, POINTER_MOTION_HINT_MASK, ENTER_NOTIFY_MASK, LEAVE_NOTIFY_MASK +from xpra.gtk_common.gobject_util import no_arg_signal from xpra.client.ui_client_base import UIXpraClient from xpra.client.gobject_client_base import GObjectXpraClient from xpra.client.client_base import PASSWORD_PROMPT @@ -59,8 +60,14 @@ EXPORT_ICON_DATA = envbool("XPRA_EXPORT_ICON_DATA", True) -class GTKXpraClient(UIXpraClient, GObjectXpraClient): - __gsignals__ = UIXpraClient.__gsignals__ +class GTKXpraClient(GObjectXpraClient, UIXpraClient): + __gsignals__ = { + "first-ui-received" : no_arg_signal, + "keyboard-sync-toggled" : no_arg_signal, + } + #add signals from super classes (all no-arg signals) + for signal_name in UIXpraClient.__signals__: + __gsignals__[signal_name] = no_arg_signal ClientWindowClass = None GLClientWindowClass = None diff --git a/src/xpra/client/mixins/clipboard.py b/src/xpra/client/mixins/clipboard.py index 113f1af25e..d8b0350326 100644 --- a/src/xpra/client/mixins/clipboard.py +++ b/src/xpra/client/mixins/clipboard.py @@ -99,15 +99,18 @@ def parse_server_capabilities(self): return True def process_ui_capabilities(self): + log("process_ui_capabilities() clipboard_enabled=%s", self.clipboard_enabled) if self.clipboard_enabled: - self.clipboard_helper = self.make_clipboard_helper() - self.clipboard_enabled = self.clipboard_helper is not None - log("clipboard helper=%s", self.clipboard_helper) - if self.clipboard_enabled and self.server_clipboard_enable_selections: - #tell the server about which selections we really want to sync with - #(could have been translated, or limited if the client only has one, etc) - log("clipboard enabled clipboard helper=%s", self.clipboard_helper) - self.send_clipboard_selections(self.clipboard_helper.remote_clipboards) + ch = self.make_clipboard_helper() + self.clipboard_helper = ch + self.clipboard_enabled = ch is not None + log("clipboard helper=%s", ch) + if self.clipboard_enabled: + if self.server_clipboard_enable_selections: + #tell the server about which selections we really want to sync with + #(could have been translated, or limited if the client only has one, etc) + self.send_clipboard_selections(ch.remote_clipboards) + ch.send_all_tokens() #ui may want to know this is now set: self.emit("clipboard-toggled") if self.server_clipboard: @@ -118,12 +121,12 @@ def process_ui_capabilities(self): def init_authenticated_packet_handlers(self): self.set_packet_handlers(self._ui_packet_handlers, { "set-clipboard-enabled": self._process_clipboard_enabled_status, - "clipboard-token": self.process_clipboard_packet, - "clipboard-request": self.process_clipboard_packet, - "clipboard-contents": self.process_clipboard_packet, - "clipboard-contents-none": self.process_clipboard_packet, - "clipboard-pending-requests": self.process_clipboard_packet, - "clipboard-enable-selections": self.process_clipboard_packet, + "clipboard-token": self._process_clipboard_packet, + "clipboard-request": self._process_clipboard_packet, + "clipboard-contents": self._process_clipboard_packet, + "clipboard-contents-none": self._process_clipboard_packet, + "clipboard-pending-requests": self._process_clipboard_packet, + "clipboard-enable-selections": self._process_clipboard_packet, }) def get_clipboard_helper_classes(self): @@ -147,7 +150,7 @@ def make_clipboard_helper(self): log.error("cannot instantiate %s", helperclass, exc_info=True) return None - def process_clipboard_packet(self, packet): + def _process_clipboard_packet(self, packet): ch = self.clipboard_helper log("process_clipboard_packet: %s, helper=%s", packet[0], ch) if ch: diff --git a/src/xpra/client/ui_client_base.py b/src/xpra/client/ui_client_base.py index d93354ab70..7afeace3a9 100644 --- a/src/xpra/client/ui_client_base.py +++ b/src/xpra/client/ui_client_base.py @@ -12,7 +12,6 @@ keylog = Logger("client", "keyboard") -from xpra.gtk_common.gobject_util import no_arg_signal from xpra.client.client_base import XpraClientBase from xpra.client.keyboard_helper import KeyboardHelper from xpra.platform import set_name @@ -50,14 +49,10 @@ class UIXpraClient(XpraClientBase, DisplayClient, WindowClient, WebcamForwarder, #NOTE: these signals aren't registered here because this class #does not extend GObject, #the gtk client subclasses will take care of it. - __gsignals__ = { - "first-ui-received" : no_arg_signal, - "keyboard-sync-toggled" : no_arg_signal, - } - #add signals from super classes (all no-arg signals) + #these are all "no-arg" signals + __signals__ = ["first-ui-received", "keyboard-sync-toggled"] for c in (DisplayClient, WindowClient, WebcamForwarder, AudioClient, ClipboardClient, NotificationClient, RPCClient, MmapClient, RemoteLogging, NetworkState, Encodings, TrayClient): - for signal_name in c.__signals__: - __gsignals__[signal_name] = no_arg_signal + __signals__ += c.__signals__ def __init__(self): log.info("Xpra %s client version %s %i-bit", self.client_toolkit(), full_version_str(), BITS)