Xpra: Ticket #11: clipboard support for OSX and win32

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?

Thu, 18 Aug 2011 11:54:22 GMT - Antoine Martin: status, description changed

Thu, 20 Oct 2011 10:19:32 GMT - Antoine Martin:

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:

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 NSApplicationWillResignActive / NSApplicationDidBecomeActive) See SetPromiseKeeper. 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.

Wed, 25 Jan 2012 09:09:10 GMT - Antoine Martin:

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)

Mon, 20 Feb 2012 19:34:00 GMT - Antoine Martin: milestone changed

Fri, 04 May 2012 09:58:38 GMT - Antoine Martin: milestone changed

Sat, 04 Aug 2012 13:31:33 GMT - Antoine Martin:

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?)

Sat, 04 Aug 2012 18:17:02 GMT - Antoine Martin:

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.

Thu, 18 Apr 2013 16:59:52 GMT - Antoine Martin: status changed

Closing this outdated ticket:

Thu, 18 Apr 2013 17:00:01 GMT - Antoine Martin: status changed; resolution set

Mon, 18 Sep 2017 04:49:45 GMT - Antoine Martin: milestone changed

Sat, 23 Jan 2021 04:43:09 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/11