From 3840a84336a3b185f55f4173715c17bbe35bc81f Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 18 Jan 2024 14:46:44 +0100 Subject: [PATCH] cleanup --- crates/eframe/Cargo.toml | 3 ++- crates/eframe/src/web/web_painter_wgpu.rs | 4 ++-- crates/egui-winit/Cargo.toml | 2 +- crates/egui_glow/Cargo.toml | 7 ++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index b8d16b66522..6b7534f8be8 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -135,9 +135,10 @@ document-features = { version = "0.2", optional = true } egui_glow = { version = "0.25.0", path = "../egui_glow", optional = true, default-features = false } glow = { workspace = true, optional = true } +# glutin stuck on old version of raw-window-handle: rwh_05 = { package = "raw-window-handle", version = "0.5.2", optional = true, features = [ "std", -] } # glutin stuck on old version of raw-window-handle +] } ron = { version = "0.8", optional = true, features = ["integer128"] } serde = { version = "1", optional = true, features = ["derive"] } diff --git a/crates/eframe/src/web/web_painter_wgpu.rs b/crates/eframe/src/web/web_painter_wgpu.rs index 477e9e1026c..845b4038cd1 100644 --- a/crates/eframe/src/web/web_painter_wgpu.rs +++ b/crates/eframe/src/web/web_painter_wgpu.rs @@ -18,7 +18,7 @@ struct EguiWebWindow(u32); #[allow(unsafe_code)] impl HasWindowHandle for EguiWebWindow { fn window_handle(&self) -> Result, HandleError> { - // SAFETY: it's web. I'm sure its fine. + // SAFETY: there is no lifetime here. unsafe { Ok(WindowHandle::borrow_raw(RawWindowHandle::Web( WebWindowHandle::new(self.0), @@ -30,7 +30,7 @@ impl HasWindowHandle for EguiWebWindow { #[allow(unsafe_code)] impl HasDisplayHandle for EguiWebWindow { fn display_handle(&self) -> Result, HandleError> { - // SAFETY: it's web. I'm sure its fine. + // SAFETY: there is no lifetime here. unsafe { Ok(DisplayHandle::borrow_raw(RawDisplayHandle::Web( WebDisplayHandle::new(), diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index ddeb94fd2a9..1324e8091a3 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -61,7 +61,7 @@ egui = { version = "0.25.0", path = "../egui", default-features = false, feature log = { version = "0.4", features = ["std"] } raw-window-handle.workspace = true web-time = { version = "0.2" } # We use web-time so we can (maybe) compile for web -winit = { workspace = true, default-features = false } +winit = { workspace = true, default-features = false, features = ["rwh_06"] } #! ### Optional dependencies diff --git a/crates/egui_glow/Cargo.toml b/crates/egui_glow/Cargo.toml index 75cafcc46a4..5174ee30161 100644 --- a/crates/egui_glow/Cargo.toml +++ b/crates/egui_glow/Cargo.toml @@ -52,9 +52,10 @@ bytemuck = "1.7" glow.workspace = true log = { version = "0.4", features = ["std"] } memoffset = "0.7" +# glutin stuck on old version of raw-window-handle: rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [ "std", -] } # glutin stuck on old version of raw-window-handle +] } #! ### Optional dependencies ## Enable this when generating docs. @@ -65,9 +66,9 @@ document-features = { version = "0.2", optional = true } egui-winit = { version = "0.25.0", path = "../egui-winit", optional = true, default-features = false } puffin = { workspace = true, optional = true } winit = { workspace = true, optional = true, default-features = false, features = [ - "rwh_05", + "rwh_05", # glutin stuck on old version of raw-window-handle "rwh_06", # for compatibility with egui-winit -] } # glutin stuck on old version of raw-window-handle +] } # Web: [target.'cfg(target_arch = "wasm32")'.dependencies]