Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clipboard support for OSX and win32 #11

Closed
totaam opened this issue Aug 18, 2011 · 8 comments
Closed

clipboard support for OSX and win32 #11

totaam opened this issue Aug 18, 2011 · 8 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Aug 18, 2011

Issue migrated from trac ticket # 11

component: client | priority: major | resolution: duplicate

2011-08-18 12:42:58: antoine created the issue


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?

@totaam
Copy link
Collaborator Author

totaam commented Oct 20, 2011

2011-10-20 11:19:33: antoine commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Oct 20, 2011

2011-10-20 11:19:33: totaam

@totaam
Copy link
Collaborator Author

totaam commented Jan 25, 2012

2012-01-25 09:09:11: totaam commented


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)

@totaam
Copy link
Collaborator Author

totaam commented Aug 4, 2012

2012-08-04 14:31:33: antoine commented


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 1230 + 1234

Still some work needed on win32, testing on osx (what selections are available there?)

@totaam
Copy link
Collaborator Author

totaam commented Aug 4, 2012

2012-08-04 19:17:03: antoine commented


  • 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.

@totaam
Copy link
Collaborator Author

totaam commented Apr 18, 2013

2013-04-18 17:59:53: totaam commented


Closing this outdated ticket:

@totaam
Copy link
Collaborator Author

totaam commented Apr 18, 2013

2013-04-18 18:00:02: totaam changed resolution from ** to duplicate

@totaam totaam closed this as completed Apr 18, 2013
@totaam
Copy link
Collaborator Author

totaam commented Sep 18, 2017

2017-09-18 05:49:46: antoine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant