xpra icon
Bug tracker and wiki

Opened 6 years ago

Closed 4 years ago

Last modified 22 months ago

#11 closed task (duplicate)

clipboard support for OSX and win32

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: future
Component: client Version:
Keywords: Cc:

Change History (9)

comment:1 Changed 6 years ago by Antoine Martin

Description: modified (diff)
Status: newaccepted

comment:2 Changed 6 years ago by Antoine Martin

Added partial support for win32 in r241 (see commit message)

Still need to:

  • add more transformation code for X11 atoms to strings and back
  • maybe allow win32 user to choose which clipboard it shares with? ("PRIMARY" vs "SECONDARY" vs "CLIPBOARD"..)

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

Last edited 4 years ago by Antoine Martin (previous) (diff)

comment:3 Changed 5 years ago by 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)

Last edited 5 years ago by Antoine Martin (previous) (diff)

comment:4 Changed 5 years ago by Antoine Martin

Milestone: current0.2

comment:5 Changed 5 years ago by Antoine Martin

Milestone: 0.2future

comment:6 Changed 5 years ago by 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?)

comment:7 Changed 5 years ago by Antoine Martin

  • r1278 fixes keyboard targets for non-X11 systems
  • r1279 allows win32 users to choose which remote keyboard to sync with via a nice UI menu

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.

comment:8 Changed 4 years ago by Antoine Martin

Status: acceptednew

Closing this outdated ticket:

Last edited 4 years ago by Antoine Martin (previous) (diff)

comment:9 Changed 4 years ago by Antoine Martin

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.