Skip to content

Commit

Permalink
#812 native X11 clipboard
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@22234 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 28, 2019
1 parent faa8e16 commit 2f1125c
Show file tree
Hide file tree
Showing 5 changed files with 557 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/xpra/clipboard/clipboard_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ def send_targets_only():
return
target = send_now[0]
def got_contents(dtype, dformat, data):
log("got_contents for selection %s: %s, %s, %s", selection, dtype, dformat, repr_ellipsized(data))
log("got_contents for selection %s: %s, %s, %s",
selection, dtype, dformat, repr_ellipsized(str(data)))
#code mostly duplicated from _process_clipboard_request
#see there for details
if dtype is None or data is None:
Expand Down
4 changes: 3 additions & 1 deletion src/xpra/platform/xposix/features.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of Xpra.
# Copyright (C) 2010 Nathaniel Smith <njs@pobox.com>
# Copyright (C) 2011-2017 Antoine Martin <antoine@xpra.org>
# Copyright (C) 2011-2019 Antoine Martin <antoine@xpra.org>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.

Expand Down Expand Up @@ -31,6 +31,8 @@
]

DEFAULT_SSH_CMD = "ssh"

CLIPBOARD_NATIVE_CLASS = "xpra.x11.gtk_x11.clipboard.X11Clipboard"
CLIPBOARDS=["CLIPBOARD", "PRIMARY", "SECONDARY"]

OPEN_COMMAND = ["/usr/bin/xdg-open"]
Expand Down
7 changes: 4 additions & 3 deletions src/xpra/server/mixins/clipboard_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ def init_clipboard(self):
self.clipboard_filter_file, exc_info=True)
return
try:
from xpra.clipboard.gdk_clipboard import GDKClipboardProtocolHelper
#from xpra.clipboard.gdk_clipboard import GDKClipboardProtocolHelper as X11Clipboard
from xpra.x11.gtk_x11.clipboard import X11Clipboard
kwargs = {
"filters" : clipboard_filter_res,
"can-send" : self.clipboard_direction in ("to-client", "both"),
"can-receive" : self.clipboard_direction in ("to-server", "both"),
}
self._clipboard_helper = GDKClipboardProtocolHelper(self.send_clipboard_packet,
self.clipboard_progress, **kwargs)
self._clipboard_helper = X11Clipboard(self.send_clipboard_packet,
self.clipboard_progress, **kwargs)
self._clipboard_helper.init_proxies_uuid()
self._clipboards = CLIPBOARDS
except Exception:
Expand Down
5 changes: 3 additions & 2 deletions src/xpra/x11/bindings/window_bindings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -811,13 +811,14 @@ cdef class _X11WindowBindings(_X11CoreBindings):
self.context_check()
self.addXSelectInput(xwindow, SelectionNotify)

def sendSelectionNotify(self, Window xwindow, selection, property, time=CurrentTime):
def sendSelectionNotify(self, Window xwindow, selection, target, property, time=CurrentTime):
self.context_check()
cdef XEvent e #@DuplicatedSignature
e.type = SelectionNotify
e.xselection.requestor = xwindow
e.xselection.selection = self.xatom(selection)
e.xselection.target = xwindow
e.xselection.target = self.xatom(target)
e.xselection.property = self.xatom(property)
e.xselection.time = time
if property:
e.xselection.property = self.xatom(property)
Expand Down
Loading

0 comments on commit 2f1125c

Please sign in to comment.