diff --git a/crates/egui-winit/src/clipboard.rs b/crates/egui-winit/src/clipboard.rs index cec4b43c..fc733438 100644 --- a/crates/egui-winit/src/clipboard.rs +++ b/crates/egui-winit/src/clipboard.rs @@ -5,7 +5,10 @@ use raw_window_handle::RawDisplayHandle; /// If the "clipboard" feature is off, or we cannot connect to the OS clipboard, /// then a fallback clipboard that just works within the same app is used instead. pub struct Clipboard { - #[cfg(all(feature = "arboard", not(target_os = "android")))] + #[cfg(all( + not(any(target_os = "android", target_os = "ios")), + feature = "arboard", + ))] arboard: Option, #[cfg(all( @@ -28,7 +31,10 @@ impl Clipboard { /// Construct a new instance pub fn new(_raw_display_handle: Option) -> Self { Self { - #[cfg(all(feature = "arboard", not(target_os = "android")))] + #[cfg(all( + not(any(target_os = "android", target_os = "ios")), + feature = "arboard", + ))] arboard: init_arboard(), #[cfg(all( @@ -68,7 +74,10 @@ impl Clipboard { }; } - #[cfg(all(feature = "arboard", not(target_os = "android")))] + #[cfg(all( + not(any(target_os = "android", target_os = "ios")), + feature = "arboard", + ))] if let Some(clipboard) = &mut self.arboard { return match clipboard.get_text() { Ok(text) => Some(text), @@ -98,7 +107,10 @@ impl Clipboard { return; } - #[cfg(all(feature = "arboard", not(target_os = "android")))] + #[cfg(all( + not(any(target_os = "android", target_os = "ios")), + feature = "arboard", + ))] if let Some(clipboard) = &mut self.arboard { if let Err(err) = clipboard.set_text(text) { log::error!("arboard copy/cut error: {err}"); @@ -110,7 +122,10 @@ impl Clipboard { } pub fn set_image(&mut self, image: &egui::ColorImage) { - #[cfg(all(feature = "arboard", not(target_os = "android")))] + #[cfg(all( + not(any(target_os = "android", target_os = "ios")), + feature = "arboard", + ))] if let Some(clipboard) = &mut self.arboard { if let Err(err) = clipboard.set_image(arboard::ImageData { width: image.width(), @@ -130,7 +145,10 @@ impl Clipboard { } } -#[cfg(all(feature = "arboard", not(target_os = "android")))] +#[cfg(all( + not(any(target_os = "android", target_os = "ios")), + feature = "arboard", +))] fn init_arboard() -> Option { profiling::function_scope!();