From 3a9dbd64e94a64b3015e0de9aba581d531f81c2a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 23 Apr 2019 10:22:12 +0000 Subject: [PATCH] #812 fix shadow servers to load platform specific clipboard support git-svn-id: https://xpra.org/svn/Xpra/trunk@22519 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/server/mixins/clipboard_server.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/xpra/server/mixins/clipboard_server.py b/src/xpra/server/mixins/clipboard_server.py index a116e3cb41..df6fbcceac 100644 --- a/src/xpra/server/mixins/clipboard_server.py +++ b/src/xpra/server/mixins/clipboard_server.py @@ -103,10 +103,13 @@ def init_clipboard(self): self.clipboard_filter_file, exc_info=True) return try: - if POSIX and not OSX: - from xpra.x11.gtk_x11.clipboard import X11Clipboard as ClipboardClass #@UnusedImport - else: - from xpra.clipboard.gdk_clipboard import GDKClipboardProtocolHelper as ClipboardClass #@Reimport + from xpra.platform.features import CLIPBOARD_NATIVE_CLASS + assert CLIPBOARD_NATIVE_CLASS, "no native clipboard support" + parts = CLIPBOARD_NATIVE_CLASS.split(".") + mod = ".".join(parts[:-1]) + module = __import__(mod, {}, {}, [parts[-1]]) + ClipboardClass = getattr(module, parts[-1]) + log("ClipboardClass for %s: %s", CLIPBOARD_NATIVE_CLASS, ClipboardClass) kwargs = { "filters" : clipboard_filter_res, "can-send" : self.clipboard_direction in ("to-client", "both"),