-
Notifications
You must be signed in to change notification settings - Fork 104
Closed
Labels
O-UNIXWork related to X11 or Wayland on UNIX platformsWork related to X11 or Wayland on UNIX platformsdocumentationImprovements or additions to documentationImprovements or additions to documentation
Description
When using a different function for handling the creation of Clipboard and usage of set_text, the clipboard content is not set.
use arboard::Clipboard;
use std::thread::sleep;
use core::time::Duration;
fn main() {
let data = String::from("hello world");
println!("before copy_text");
copy_text(data);
println!("after copy_text");
let d = Duration::from_millis(2500);
sleep(d);
println!("exiting (after 2.5s)");
std::process::exit(0);
// clipboard content will NOT be "hello world"
}
fn copy_text(content: String) {
let mut instance = Clipboard::new().unwrap();
instance.set_text(&content).unwrap();
}I do not want to put a sleep inside of copy_text since I want stuff to run instantly after that and only wait 2s before actually exiting the application.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
O-UNIXWork related to X11 or Wayland on UNIX platformsWork related to X11 or Wayland on UNIX platformsdocumentationImprovements or additions to documentationImprovements or additions to documentation