Skip to content

Commit

Permalink
the server expects an entry for "clipboard", so we can't use better s…
Browse files Browse the repository at this point in the history
…tructured caps

git-svn-id: https://xpra.org/svn/Xpra/trunk@18597 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 25, 2018
1 parent ed555e0 commit 79daf65
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions src/xpra/client/mixins/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from xpra.client.mixins.stub_client_mixin import StubClientMixin
from xpra.platform.features import CLIPBOARD_WANT_TARGETS, CLIPBOARD_GREEDY, CLIPBOARDS
from xpra.scripts.config import FALSE_OPTIONS
from xpra.util import flatten_dict
from xpra.os_util import bytestostr
try:
from xpra.clipboard.clipboard_base import ALL_CLIPBOARDS
Expand Down Expand Up @@ -55,17 +56,20 @@ def cleanup(self):
log.error("error on clipboard helper '%s' cleanup", ch, exc_info=True)


def get_clipboard_caps(self):
return {
"" : self.client_supports_clipboard,
"notifications" : self.client_supports_clipboard,
"selections" : CLIPBOARDS,
#buggy osx clipboards:
"want_targets" : CLIPBOARD_WANT_TARGETS,
#buggy osx and win32 clipboards:
"greedy" : CLIPBOARD_GREEDY,
"set_enabled" : True,
}
def get_caps(self):
caps = flatten_dict({
"clipboard" : {
"notifications" : self.client_supports_clipboard,
"selections" : CLIPBOARDS,
#buggy osx clipboards:
"want_targets" : CLIPBOARD_WANT_TARGETS,
#buggy osx and win32 clipboards:
"greedy" : CLIPBOARD_GREEDY,
"set_enabled" : True,
},
})
caps["clipboard"] = self.client_supports_clipboard
return caps

def parse_server_capabilities(self):
c = self.server_capabilities
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ def make_hello(self):
caps.update(DisplayClient.get_caps(self))
caps.update(NetworkState.get_caps(self))
caps.update(Encodings.get_caps(self))
caps.update(ClipboardClient.get_caps(self))
caps.update(self.get_keyboard_caps())
#nicely prefixed:
def u(prefix, c):
updict(caps, prefix, c, flatten_dicts=False)
u("sound", AudioClient.get_audio_capabilities(self))
u("notifications", self.get_notifications_caps())
u("clipboard", self.get_clipboard_caps())
u("control_commands", self.get_control_commands_caps())
u("platform", get_platform_info())
mmap_caps = MmapClient.get_caps(self)
Expand Down

0 comments on commit 79daf65

Please sign in to comment.