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 with world only, not view? #32

Closed
jpcima opened this issue May 26, 2020 · 5 comments
Closed

Clipboard with world only, not view? #32

jpcima opened this issue May 26, 2020 · 5 comments

Comments

@jpcima
Copy link
Contributor

jpcima commented May 26, 2020

Hello, the current clipboard API requires a view so the content may be accessed.
May it possibly have functions do to do, but with world only?

For context, my task is to port the GUI library elements on top of Pugl.
cycfi/elements#111

The clipboard access routines of this library don't provide the view as a parameter.
It's how they do for 3 portability layers: Mac, Win, Gtk
For Pugl, it's a small obstacle, so I wonder if it could be modified to operate the same, if this model would make sense.

@drobilla
Copy link
Collaborator

Hm. Unfortunately I'm not sure it's so small of an obstacle. The X selection is owned by a Window (like nearly everything in X). Similarly, it seems the clipboard is based around a HWND on Windows. Only on MacOS does this look totally straightforward.

Given that the clipboard API is (somewhat unfortunately) not event-based, conceptually it seems like this should be feasible from an API POV, at first glance anyway. But if it requires keeping some fake window around just to deal with the clipboard... that might not be very fun.

@drobilla
Copy link
Collaborator

(As a stop-gap I suppose you could always just do this yourself. I think it should work with an invisible view)

@jpcima
Copy link
Contributor Author

jpcima commented May 27, 2020

This explanation makes sense. I have some options to hack it on plugin-side, so not the biggest deal.
Do I leave the issue open?

@drobilla
Copy link
Collaborator

Sure, leave it open. Maybe making a window but never mapping it works and isn't too ugly...

I'd be interested to know if using PuglView in a similar way in a plugin works out anyway.

@drobilla
Copy link
Collaborator

I'm just going to go with "no" on this one. The platforms are the way that they are, I generally try to avoid Pugl pretending too much. Clipboards being associated with windows seems to be the norm, if anything.

I imagine that whatever tricks one uses to do that (like using an invisible window) will work when implemented using Pugl, but I haven't tried it. Please open a specific issue if you encounter problems doing this.

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

No branches or pull requests

2 participants