diff --git a/crates/egui-winit/CHANGELOG.md b/crates/egui-winit/CHANGELOG.md index dfe4fe43..317786e3 100644 --- a/crates/egui-winit/CHANGELOG.md +++ b/crates/egui-winit/CHANGELOG.md @@ -3,7 +3,8 @@ All notable changes to the `egui-winit` integration will be noted in this file. ## Unreleased - +* The default features of the `winit` crate are not enabled if the default features of `egui-winit` are disabled too ([#1971](https://github.com/emilk/egui/pull/1971)) +* Added new feature `wayland` which enables Wayland support ([#1971](https://github.com/emilk/egui/pull/1971)) ## 0.19.0 - 2022-08-20 * MSRV (Minimum Supported Rust Version) is now `1.61.0` ([#1846](https://github.com/emilk/egui/pull/1846)). diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index fa38f0ad..46b6ba5f 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -18,7 +18,7 @@ all-features = true [features] -default = ["clipboard", "links"] +default = ["clipboard", "links", "wayland", "winit/default"] ## [`bytemuck`](https://docs.rs/bytemuck) enables you to cast [`egui::epaint::Vertex`], [`egui::Vec2`] etc to `&[u8]`. bytemuck = ["egui/bytemuck"] @@ -39,6 +39,8 @@ screen_reader = ["tts"] ## Allow serialization of [`WindowSettings`] using [`serde`](https://docs.rs/serde). serde = ["egui/serde", "dep:serde"] +## Enables Wayland support. +wayland = ["winit/wayland"] [dependencies] egui = { version = "0.19.0", path = "../egui", default-features = false, features = [ @@ -46,7 +48,7 @@ egui = { version = "0.19.0", path = "../egui", default-features = false, feature ] } instant = { version = "0.1", features = ["wasm-bindgen"] } # We use instant so we can (maybe) compile for web tracing = { version = "0.1", default-features = false, features = ["std"] } -winit = "0.27.2" +winit = { version = "0.27.2", default-features = false } #! ### Optional dependencies diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 1f230a41..d0b8323f 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -21,6 +21,8 @@ mod window_settings; pub use window_settings::WindowSettings; use winit::event_loop::EventLoopWindowTarget; + +#[cfg(feature = "wayland")] #[cfg(any( target_os = "linux", target_os = "dragonfly", @@ -777,6 +779,7 @@ fn translate_cursor(cursor_icon: egui::CursorIcon) -> Option(_event_loop: &EventLoopWindowTarget) -> Option<*mut c_void> { + #[cfg(feature = "wayland")] #[cfg(any( target_os = "linux", target_os = "dragonfly", diff --git a/sh/check.sh b/sh/check.sh index 239afd9f..f8f92bdf 100755 --- a/sh/check.sh +++ b/sh/check.sh @@ -37,7 +37,8 @@ cargo doc --document-private-items --no-deps --all-features (cd crates/egui_extras && cargo check --no-default-features) (cd crates/egui_glium && cargo check --no-default-features) (cd crates/egui_glow && cargo check --no-default-features) -(cd crates/egui-winit && cargo check --no-default-features) +(cd crates/egui-winit && cargo check --no-default-features --features "wayland") +(cd crates/egui-winit && cargo check --no-default-features --features "winit/x11") (cd crates/emath && cargo check --no-default-features) (cd crates/epaint && cargo check --no-default-features --release) (cd crates/epaint && cargo check --no-default-features)