aweinstock314 / rust-clipboard

System Clipboard interfacing library in Rust
Apache License 2.0
365 stars 75 forks source link

Incorrect behaviour on Linux with two clipboards #84

Open john01dav opened 2 years ago

john01dav commented 2 years ago

I encountered this bug when using this library to implement copy/paste for my GUI library. It turns out that on Linux there are two clipboards that most programs interact with differently. I'd like to implement this standard (albeit very strange) behaviour in my GUI library, but this library does not currently have support for this as far as I can tell.

Ryan1729 commented 2 years ago

I'm not affiliated with this crate, but I happened to look at this issue and I want to point out that this library does have some support for the "Primary Selection", (the second clipboard.)

Specifically you can get an X11ClipboardContext<Primary> as well as a X11ClipboardContext<Clipboard>, which both implement ClipboardProvider. By default you get an X11ClipboardContext<Clipboard>, but you can specify that you want an X11ClipboardContext<Primary>. So, under X11 you can access both clipboards separately.

The crate has this brief example showing use of an X11ClipboardContext<Primary>.