Some pointers which may be useful:
Notes: it doesn't look like OSX supports events...
Carbon.Scrap.InfoScrap() has a serial number, so maybe we can poll/compare that?
Added partial support for win32 in r241 (see commit message)
Still need to:
OSX support is just really tedious, the GTK stuff does not work:
self.selection_owner_set(self._selection): Failed to acquire local clipboard CLIPBOARD; will not be able to pass local apps contents of remote clipboard
The apple pasteboards doc seems to have sync methods, but none that would call back to us whenever the clipboard's contents changes so we may have to poll it whenever we get a clipboard message from the server or when the application becomes (in)active. (via
The only python code I can find that does anything remotely similar is
clipboard/carbon.py (now dead link) which uses pyglet.. not keen on adding yet-another-dependency, but may have to.
Note that there are already problems with the clipboard code and its nested main loop, see #52 and #8, and also:
xpra/platform/clipboard_base.py:232: GtkWarning: IA__gdk_x11_atom_to_xatom_for_display: assertion `ATOM_TO_INDEX (atom) < virtual_atom_array->len' failed gtk.Invisible.do_selection_request_event(self, event)
So it may be worth re-working the whole thing using deferred (ala twisted)
Much improved support (support for gdk atoms on non-X11 platforms) in r1274
The fix for the
GtkWarning: IA__gdk_x11_atom_to_xatom_for_display warning was already in r1230 + r1234
Still some work needed on win32, testing on osx (what selections are available there?)
As for OSX... it doesn't look like GTK is going to get the fix anytime soon. So if we wanted to support it, we would need to write the code ourselves - yuk.
Closing this outdated ticket:
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/11