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

Is Wayland now supported or not? #52

Closed
MultisampledNight opened this issue Jun 6, 2022 · 3 comments
Closed

Is Wayland now supported or not? #52

MultisampledNight opened this issue Jun 6, 2022 · 3 comments

Comments

@MultisampledNight
Copy link

The README mentions

The Linux implementation uses the X protocol by default for managing the clipboard but fear not because Wayland works with the X11 protocoll [!] just as well.

which is a lie, because there's no guarantee that Xwayland may be running. But on the code side, there does seem to be an implementation for native Wayland:

pub(crate) fn set_text_with_clipboard(
&self,
text: String,
selection: LinuxClipboardKind,
) -> Result<(), Error> {
use wl_clipboard_rs::copy::MimeType;
let mut opts = Options::new();
opts.clipboard(selection.try_into()?);
let source = Source::Bytes(text.as_bytes().into());
opts.copy(source, MimeType::Text).map_err(|e| match e {
CopyError::PrimarySelectionUnsupported => Error::ClipboardNotSupported,
other => into_unknown(other),
})?;
Ok(())
}

This confuses me a bit. Is there Wayland support now or not? (I'm seeing if Neovide could migrate from clipboard to arboard, but relying on Xwayland is... well, dangerous)

@complexspaces
Copy link
Collaborator

Hey there,

arboard should support native Wayland environments as the current crate used for that, wl_clipboard_rs, does as well. I'm not entirely sure what the README is comment is trying to say. It may have been an attempt to say something about Xwayland, just in the wrong order.

The egui project also noted that it worked, but with the caveat that our current implementation only supports terminal apps correctly.

As a disclaimer, I have not tested it myself in a pure Wayland environment, nor does 1Password for Linux enable the feature (yet), so I can only speak for what the code should support.

@MultisampledNight
Copy link
Author

Alright, thank you. I guess I have to wait then.

@danielboston38
Copy link

i would like to second this feature request. i have to use xwayland on my system and i think its causing lots of performance issues.

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

3 participants