diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index a8ff25b2910..0397074edf1 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -89,7 +89,7 @@ wayland = [ "egui_glow?/wayland", "glutin?/wayland", "glutin-winit?/wayland", - "egui-winit/smithay-clipboard", + "egui-winit/clipboard-wayland", ] ## Enable screen reader support (requires `ctx.options_mut(|o| o.screen_reader = true);`) on web. @@ -124,7 +124,7 @@ x11 = [ "glutin?/glx", "glutin-winit?/x11", "glutin-winit?/glx", - "egui-winit/arboard", + "egui-winit/clipboard-nonwayland", ] ## If set, eframe will look for the env-var `EFRAME_SCREENSHOT_TO` and write a screenshot to that location, and then quit. @@ -187,7 +187,7 @@ wgpu = { workspace = true, optional = true, features = [ # mac: [target.'cfg(any(target_os = "macos"))'.dependencies] egui-winit = { workspace = true, default-features = false, features = [ - "arboard", + "clipboard-nonwayland", "links", ] } objc2 = "0.5.1" @@ -207,7 +207,7 @@ objc2-app-kit = { version = "0.2.0", features = [ # windows: [target.'cfg(any(target_os = "windows"))'.dependencies] egui-winit = { workspace = true, default-features = false, features = [ - "arboard", + "clipboard-nonwayland", "links", ] } winapi = { version = "0.3.9", features = ["winuser"] } diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index c584db85e70..8589b56bd59 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -21,7 +21,7 @@ all-features = true rustdoc-args = ["--generate-link-to-definition"] [features] -default = ["clipboard", "links", "wayland", "winit/default", "x11"] +default = ["clipboard-nonwayland", "links", "wayland", "winit/default", "x11"] ## Enable platform accessibility API implementations through [AccessKit](https://accesskit.dev/). accesskit = ["dep:accesskit_winit", "egui/accesskit"] @@ -40,7 +40,13 @@ bytemuck = ["egui/bytemuck"] ## Enable cut/copy/paste to OS clipboard. ## If disabled a clipboard will be simulated so you can still copy/paste within the egui app. -clipboard = ["arboard", "smithay-clipboard"] +clipboard = ["clipboard-nonwayland", "clipboard-wayland"] +## Enable cut/copy/paste to OS clipboard on **non-wayland** systems. +## If disabled a clipboard will be simulated so you can still copy/paste within the egui app. +clipboard-nonwayland = ["arboard"] +## Enable cut/copy/paste to OS clipboard on **wayland** systems. +## If disabled a clipboard will be simulated so you can still copy/paste within the egui app. +clipboard-wayland = ["wayland", "smithay-clipboard"] ## Enable opening links in a browser when an egui hyperlink is clicked. links = ["webbrowser"] diff --git a/crates/egui-winit/src/clipboard.rs b/crates/egui-winit/src/clipboard.rs index c4192f78d55..8403fb36a03 100644 --- a/crates/egui-winit/src/clipboard.rs +++ b/crates/egui-winit/src/clipboard.rs @@ -47,6 +47,8 @@ impl Clipboard { } } + #[allow(clippy::unnecessary_wraps)] // for implementation consistency + #[allow(clippy::needless_pass_by_ref_mut)] // for implementation consistency pub fn get(&mut self) -> Option { #[cfg(all( any( diff --git a/crates/egui_glow/Cargo.toml b/crates/egui_glow/Cargo.toml index 7a402d4067a..fed6d935872 100644 --- a/crates/egui_glow/Cargo.toml +++ b/crates/egui_glow/Cargo.toml @@ -33,7 +33,7 @@ default = [] ## enable cut/copy/paste to os clipboard. ## ## if disabled a clipboard will be simulated so you can still copy/paste within the egui app. -clipboard = ["egui-winit?/clipboard"] +clipboard = ["egui-winit?/clipboard-nonwayland"] ## For the `winit` integration: ## enable opening links in a browser when an egui hyperlink is clicked. @@ -43,7 +43,7 @@ links = ["egui-winit?/links"] winit = ["egui-winit", "dep:winit"] ## Enables Wayland support for winit. -wayland = ["winit?/wayland"] +wayland = ["winit?/wayland", "egui-winit/clipboard-wayland"] ## Enables x11 support for winit. x11 = ["winit?/x11"]