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

Aplications freeze when pasting from cli_clipboard #17

Open
Paradyx opened this issue Feb 15, 2023 · 1 comment
Open

Aplications freeze when pasting from cli_clipboard #17

Paradyx opened this issue Feb 15, 2023 · 1 comment

Comments

@Paradyx
Copy link

Paradyx commented Feb 15, 2023

I experience issues with wormhole-rs that uses cli_clipboard under the hood. When i try pasting to a third application (Signal Desktop, cutsel) they freeze for some time or fail entirely. I think cli-clipoard is at fault because I never experience freezes when copying from other sources. Pasting to Firefox and Libre Office Writer works for some reasons.

Steps to reproduce:

I implemented a little demo with cli-clipboard = "0.4" to eliminate other factors.

use std::io::prelude::*;
use std::io::stdin;
use std::io::stdout;

use cli_clipboard::{ClipboardContext, ClipboardProvider};

fn main() {
    let mut ctx = ClipboardContext::new().unwrap();
    let the_string = "Hello, world!";
    ctx.set_contents(the_string.to_owned()).unwrap();

    // Keep application running until any key is pressed.
    write!(stdout(), "Press any key to continue...").unwrap();
    stdout().flush().unwrap();
    let _ = stdin().read(&mut [0u8]).unwrap();
}

With Signal Desktop:

  1. On the demo cargo run
  2. Ctrl+V in Signal Desktop
    -> Signal Desktop freezes for a couple of seconds and successfully pasts the text afterwards.

With cutsel

  1. On the demo cargo run
  2. In another terminal cutsel -v -d -s CLIPBOARD sel
    -> crashes with the following output
$ cutsel -v -d -s CLIPBOARD sel
cutsel v0.10.1
X Error of failed request:  BadAtom (invalid Atom parameter)
  Major opcode of failed request:  17 (X_GetAtomName)
  Atom id in failed request:  0x80000001
  Serial number of failed request:  22
  Current serial number in output stream:  22

Other information

I'm running an up-to-date Archlinux with i3-wm. FWI, a couple installed packages that might be of importance.

i3-wm 4.22-3
xorg-server 21.1.7-1
xclip 0.13-3
signal-desktop 6.5.1-1

Please let me know if you need any additional information.

@allie-wake-up
Copy link
Owner

I don't have time to try it out right this second, but I'm hoping this upstream fix will fix this: quininer/x11-clipboard#34

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