diff --git a/Cargo.toml b/Cargo.toml index fe55b02..0b01204 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "window_clipboard" -version = "0.1.1" +version = "0.1.2" authors = ["Héctor Ramón Jiménez "] edition = "2018" description = "A library to obtain clipboard access from a `raw-window-handle`" @@ -15,14 +15,14 @@ categories = ["gui"] raw-window-handle = "0.3" [target.'cfg(windows)'.dependencies] -clipboard-win = "2.1" +clipboard-win = { version = "4.0", features = ["std"] } [target.'cfg(target_os = "macos")'.dependencies] -clipboard_macos = { version = "0.1.0", path = "./macos" } +clipboard_macos = { version = "0.1", path = "./macos" } [target.'cfg(all(unix, not(any(target_os="macos", target_os="android", target_os="emscripten", target_os="ios"))))'.dependencies] -clipboard_x11 = { version = "0.1.0", path = "./x11" } -clipboard_wayland = { version = "0.1.0", path = "./wayland" } +clipboard_x11 = { version = "0.1", path = "./x11" } +clipboard_wayland = { version = "0.1", path = "./wayland" } [dev-dependencies] winit = "0.22" diff --git a/wayland/Cargo.toml b/wayland/Cargo.toml index 48959a1..08e2885 100644 --- a/wayland/Cargo.toml +++ b/wayland/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clipboard_wayland" -version = "0.1.0" +version = "0.1.1" authors = ["Héctor Ramón Jiménez "] edition = "2018" description = "A library to obtain access to the clipboard of a Wayland window" @@ -10,4 +10,4 @@ documentation = "https://docs.rs/clipboard_wayland" keywords = ["clipboard", "wayland"] [dependencies] -smithay-clipboard = "0.3.4" +smithay-clipboard = "0.5.1" diff --git a/wayland/src/lib.rs b/wayland/src/lib.rs index cd60054..9d4b92c 100644 --- a/wayland/src/lib.rs +++ b/wayland/src/lib.rs @@ -16,27 +16,25 @@ use std::error::Error; use std::ffi::c_void; use std::sync::{Arc, Mutex}; -use smithay_clipboard::WaylandClipboard; - pub struct Clipboard { - context: Arc>, + context: Arc>, } impl Clipboard { pub unsafe fn new(display: *mut c_void) -> Clipboard { - let context = Arc::new(Mutex::new( - WaylandClipboard::new_from_external(display as *mut _), - )); + let context = Arc::new(Mutex::new(smithay_clipboard::Clipboard::new( + display as *mut _, + ))); Clipboard { context } } pub fn read(&self) -> Result> { - Ok(self.context.lock().unwrap().load(None)) + Ok(self.context.lock().unwrap().load()?) } pub fn write(&mut self, data: String) -> Result<(), Box> { - self.context.lock().unwrap().store(None, data); + self.context.lock().unwrap().store(data); Ok(()) }