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 is broken on Wayland #1612

Closed
Detegr opened this issue May 9, 2022 · 1 comment · Fixed by #1613
Closed

Clipboard support is broken on Wayland #1612

Detegr opened this issue May 9, 2022 · 1 comment · Fixed by #1613
Labels
bug Something is broken

Comments

@Detegr
Copy link
Contributor

Detegr commented May 9, 2022

Describe the bug

The clipboard is not working on Wayland. arboard supports only Wayland terminal applications, not graphical applications.

To Reproduce
Steps to reproduce the behavior:

use eframe::egui;

fn main() {
    let options = eframe::NativeOptions::default();
    eframe::run_native(
        "My egui App",
        options,
        Box::new(|_cc| Box::new(MyApp::default())),
    );
}

struct MyApp {
    s: String,
}

impl Default for MyApp {
    fn default() -> Self {
        Self { s: String::new() }
    }
}

impl eframe::App for MyApp {
    fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
        egui::CentralPanel::default().show(ctx, |ui| {
            if ui.button("copy test string to clipboard").clicked() {
                ctx.output().copied_text = "hello, world!".into();
            }
            ui.text_edit_multiline(&mut self.s);
        });
    }
}
  1. Run the demo on Wayland.
  2. Try clicking the button, or copying from the text box.
  3. Nothing happens.

Expected behavior
Clipboard should work as expected.

Desktop (please complete the following information):

  • OS: Linux, Wayland
@Detegr Detegr added the bug Something is broken label May 9, 2022
@quietvoid
Copy link
Contributor

The current clipboard was super inconsistent or not working at all for me in Wayland, using eframe.
Fix in #1613 works consistently now.

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants