Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unspecified wayland/x11 dep from clipboard feature #5478

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion crates/eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ persistence = [
## If you are compiling for Linux (or want to test on a CI system using Linux), you should enable this feature.
wayland = [
"egui-winit/wayland",
"egui-winit/clipboard-wayland",
"egui-wgpu?/wayland",
"egui_glow?/wayland",
"glutin?/wayland",
Expand Down Expand Up @@ -108,6 +109,7 @@ wgpu = ["dep:wgpu", "dep:egui-wgpu", "dep:pollster"]
## Enables compiling for x11.
x11 = [
"egui-winit/x11",
"egui-winit/clipboard-nonwayland",
"egui-wgpu?/x11",
"egui_glow?/x11",
"glutin?/x11",
Expand Down Expand Up @@ -146,7 +148,6 @@ serde = { workspace = true, optional = true }
# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
egui-winit = { workspace = true, default-features = false, features = [
"clipboard",
"links",
] }
image = { workspace = true, features = ["png"] } # Needed for app icon
Expand Down Expand Up @@ -176,6 +177,10 @@ wgpu = { workspace = true, optional = true, features = [

# mac:
[target.'cfg(any(target_os = "macos"))'.dependencies]
egui-winit = { workspace = true, default-features = false, features = [
"clipboard-nonwayland",
"links",
] }
objc2 = "0.5.1"
objc2-foundation = { version = "0.2.0", features = [
"block2",
Expand All @@ -192,6 +197,10 @@ objc2-app-kit = { version = "0.2.0", features = [

# windows:
[target.'cfg(any(target_os = "windows"))'.dependencies]
egui-winit = { workspace = true, default-features = false, features = [
"clipboard-nonwayland",
"links",
] }
winapi = { version = "0.3.9", features = ["winuser"] }
windows-sys = { workspace = true, features = [
"Win32_Foundation",
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 @@ -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"]
Expand Down
Loading