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

Two Puzzling Issues in Linux #144

Open
lalala-233 opened this issue Apr 7, 2024 · 1 comment
Open

Two Puzzling Issues in Linux #144

lalala-233 opened this issue Apr 7, 2024 · 1 comment

Comments

@lalala-233
Copy link

System Information:

Operating System: Arch Linux
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.3
Kernel Version: 6.8.2-arch2-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Xeon® CPU E3-1240L v5 @ 2.10GHz
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GT 730/PCIe/SSE2

Issue One:

The following Rust code snippets behave differently, which is quite perplexing:

let mut board = arboard::Clipboard::new().unwrap();
board.set_text("hello".to_owned()).unwrap();

versus

arboard::Clipboard::new().unwrap().set_text("hello".to_owned()).unwrap();

Issue Two:

It might be a KDE issue or something related to asynchronous operations:

let mut board = arboard::Clipboard::new().unwrap();
board.set_text("hello".to_owned()).unwrap();
panic!()

This code does not work as expected, but adding a sleep before the panic:

let mut board = arboard::Clipboard::new().unwrap();
board.set_text("hello".to_owned()).unwrap();
sleep(Duration::from_millis(100));
panic!()

makes it work. I suspect that it might take some time for the information to be copied to the clipboard.

Regarding the duration of the sleep, it generally needs to be more than 5 ms on my system, which I assume is related to system performance.

Otherwise, the clipboard remains unchanged, or I end up with an empty clipboard.

Translated by Copilot

@Mikachu2333
Copy link

I've also meet the issue2, and maybe #143 and #114 are related to this

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