Fix Wayland not being available in some platforms
This commit is contained in:
parent
6f71824857
commit
2f567d9261
1 changed files with 16 additions and 0 deletions
16
src/lib.rs
16
src/lib.rs
|
|
@ -60,6 +60,14 @@ impl Clipboard {
|
|||
use clipboard::ClipboardProvider as _;
|
||||
|
||||
match &self.raw {
|
||||
#[cfg(all(
|
||||
unix,
|
||||
not(any(
|
||||
target_os = "macos",
|
||||
target_os = "android",
|
||||
target_os = "emscripten"
|
||||
))
|
||||
))]
|
||||
Raw::Wayland(clipboard) => Ok(clipboard.borrow_mut().load(None)),
|
||||
Raw::NotWayland(clipboard) => clipboard.borrow_mut().get_contents(),
|
||||
}
|
||||
|
|
@ -72,6 +80,14 @@ impl Clipboard {
|
|||
use clipboard::ClipboardProvider as _;
|
||||
|
||||
match &self.raw {
|
||||
#[cfg(all(
|
||||
unix,
|
||||
not(any(
|
||||
target_os = "macos",
|
||||
target_os = "android",
|
||||
target_os = "emscripten"
|
||||
))
|
||||
))]
|
||||
Raw::Wayland(clipboard) => {
|
||||
clipboard.borrow_mut().store(None, contents);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue