-
Notifications
You must be signed in to change notification settings - Fork 75
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
Platform dependent use patterns of arboard
#88
Comments
Thanks for opening an issue. I agree that this is problematic, and I think that I've now seen it cause enough problems that I'll be reverting the new default behavior introduced in #60 to what it was pre 3.0. Sorry for causing headaches downstream 😦. I did not think enough about how cross-platform users would be affected by the new usage pattern on Windows, which is entirely my bad. I'll be looking at this after work today. |
Thanks @complexspaces ❤️ |
I have to say it is rather unclear from the repository the correct usage pattern for the Clipboard struct. Can we expect to be able to (for all platforms and display server protocols) create multiple instances of Clipboard in numerous places in the program and drop them whenever we like without it affecting the underlying data that has either been written to or read from the Clipboard? I.e. create a new Clipboard, set some text, block ends and Clipboard is lost, and expect the text to remain paste-able. Or must we create a single instance of Clipboard and use only that when |
@derfarctor The high-level answer to your question is "no." Linux uses too different of an architecture compared to the other platforms. Do you mind looking through the documentation changes in #89 and letting me know if it would answer your question and if there's anything else you would like to see called out? |
@complexspaces The documentation is more clear there. I've changed my program to only use a single instance of Clipboard but now, as I understand is expected, it does not work properly on Windows. I eagerly await the release of the fix such that this usage pattern can be fully cross platform friendly. |
These fixes have been published as |
Since 3.0, we should now create a new
Clipboard
, use it, then drop it right away on Windows.However, I'm getting reports that that same code doesn't work on Linux X11, and that we there instead need to create a
Clipboard
once and then keep it around for the life of the program: emilk/egui#2138If true, this makes using
arboard
suddenly very annoying as I need different paths depending on what platform I am compiling for (which is exactly what I wantarboard
to help me abstract).From a users point of view, I just want access to functions to copy and paste text and images. I don't want to think about the lifetime of the
Clipboard
resource.The text was updated successfully, but these errors were encountered: