Skip to content

Commit

Permalink
Fix clipboard x11/wayland dep issue inside egui-winit as well
Browse files Browse the repository at this point in the history
  • Loading branch information
xangelix committed Dec 15, 2024
1 parent ea42bbd commit bbf18af
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
8 changes: 4 additions & 4 deletions crates/eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,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.
Expand Down Expand Up @@ -126,7 +126,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.
Expand Down Expand Up @@ -183,7 +183,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"
Expand All @@ -203,7 +203,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"] }
Expand Down
10 changes: 8 additions & 2 deletions crates/egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand Down
2 changes: 2 additions & 0 deletions crates/egui-winit/src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
#[cfg(all(
any(
Expand Down
4 changes: 2 additions & 2 deletions crates/egui_glow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -46,7 +46,7 @@ puffin = ["dep:puffin", "egui-winit?/puffin", "egui/puffin"]
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"]
Expand Down

0 comments on commit bbf18af

Please sign in to comment.