Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 18, 2024
1 parent b18d4b2 commit 3840a84
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion crates/eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }

Expand Down
4 changes: 2 additions & 2 deletions crates/eframe/src/web/web_painter_wgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct EguiWebWindow(u32);
#[allow(unsafe_code)]
impl HasWindowHandle for EguiWebWindow {
fn window_handle(&self) -> Result<WindowHandle<'_>, 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),
Expand All @@ -30,7 +30,7 @@ impl HasWindowHandle for EguiWebWindow {
#[allow(unsafe_code)]
impl HasDisplayHandle for EguiWebWindow {
fn display_handle(&self) -> Result<DisplayHandle<'_>, 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(),
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions crates/egui_glow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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]
Expand Down

0 comments on commit 3840a84

Please sign in to comment.