From c098aeeb93d35f0c9eec76267cc672dcc0fd0167 Mon Sep 17 00:00:00 2001 From: ArthurBrussee Date: Wed, 7 Aug 2024 14:50:20 +0100 Subject: [PATCH 1/3] Upgrade to winit 0.30.5 --- Cargo.lock | 116 +++++++++++++++---- Cargo.toml | 5 +- crates/eframe/src/native/glow_integration.rs | 2 +- crates/eframe/src/native/wgpu_integration.rs | 4 +- crates/egui_glow/examples/pure_glow.rs | 3 +- crates/egui_glow/src/winit.rs | 3 +- 6 files changed, 103 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4a6affbfad..22eea32e91d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -644,13 +644,39 @@ dependencies = [ "thiserror", ] +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.6.0", + "log", + "polling 3.3.0", + "rustix 0.38.21", + "slab", + "thiserror", +] + [[package]] name = "calloop-wayland-source" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ - "calloop", + "calloop 0.12.4", + "rustix 0.38.21", + "wayland-backend", + "wayland-client", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +dependencies = [ + "calloop 0.13.0", "rustix 0.38.21", "wayland-backend", "wayland-client", @@ -1150,8 +1176,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dpi" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" +source = "git+https://github.com/rust-windowing/winit.git?branch=kchibisov/release-0305#95bdaa8bdb8edad3eea5fa11d3d9b0b7f84258ee" [[package]] name = "ecolor" @@ -3490,14 +3515,14 @@ dependencies = [ [[package]] name = "sctk-adwaita" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7555fcb4f753d095d734fdefebb0ad8c98478a21db500492d87c55913d3b0086" +checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" dependencies = [ "ab_glyph", "log", "memmap2", - "smithay-client-toolkit", + "smithay-client-toolkit 0.19.2", "tiny-skia", ] @@ -3632,8 +3657,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ "bitflags 2.6.0", - "calloop", - "calloop-wayland-source", + "calloop 0.12.4", + "calloop-wayland-source 0.2.0", "cursor-icon", "libc", "log", @@ -3644,8 +3669,33 @@ dependencies = [ "wayland-client", "wayland-csd-frame", "wayland-cursor", - "wayland-protocols", - "wayland-protocols-wlr", + "wayland-protocols 0.31.2", + "wayland-protocols-wlr 0.2.0", + "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +dependencies = [ + "bitflags 2.6.0", + "calloop 0.13.0", + "calloop-wayland-source 0.3.0", + "cursor-icon", + "libc", + "log", + "memmap2", + "rustix 0.38.21", + "thiserror", + "wayland-backend", + "wayland-client", + "wayland-csd-frame", + "wayland-cursor", + "wayland-protocols 0.32.3", + "wayland-protocols-wlr 0.3.3", "wayland-scanner", "xkeysym", ] @@ -3657,7 +3707,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb62b280ce5a5cba847669933a0948d00904cf83845c944eae96a4738cea1a6" dependencies = [ "libc", - "smithay-client-toolkit", + "smithay-client-toolkit 0.18.1", "wayland-backend", ] @@ -4332,16 +4382,28 @@ dependencies = [ "wayland-scanner", ] +[[package]] +name = "wayland-protocols" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62989625a776e827cc0f15d41444a3cea5205b963c3a25be48ae1b52d6b4daaa" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + [[package]] name = "wayland-protocols-plasma" -version = "0.2.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +checksum = "f79f2d57c7fcc6ab4d602adba364bf59a5c24de57bd194486bf9b8360e06bfc4" dependencies = [ "bitflags 2.6.0", "wayland-backend", "wayland-client", - "wayland-protocols", + "wayland-protocols 0.32.3", "wayland-scanner", ] @@ -4354,7 +4416,20 @@ dependencies = [ "bitflags 2.6.0", "wayland-backend", "wayland-client", - "wayland-protocols", + "wayland-protocols 0.31.2", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd993de54a40a40fbe5601d9f1fbcaef0aebcc5fda447d7dc8f6dcbaae4f8953" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client", + "wayland-protocols 0.32.3", "wayland-scanner", ] @@ -4849,9 +4924,8 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winit" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dc930d6cfbf53c4fe0b95689cdc2e17b8658c3f4214b9953298ccb5a1a15c90" +version = "0.30.5" +source = "git+https://github.com/rust-windowing/winit.git?branch=kchibisov/release-0305#95bdaa8bdb8edad3eea5fa11d3d9b0b7f84258ee" dependencies = [ "ahash", "android-activity", @@ -4859,7 +4933,7 @@ dependencies = [ "bitflags 2.6.0", "block2", "bytemuck", - "calloop", + "calloop 0.13.0", "cfg_aliases 0.2.1", "concurrent-queue", "core-foundation", @@ -4881,7 +4955,7 @@ dependencies = [ "redox_syscall 0.4.1", "rustix 0.38.21", "sctk-adwaita", - "smithay-client-toolkit", + "smithay-client-toolkit 0.19.2", "smol_str", "tracing", "unicode-segmentation", @@ -4889,7 +4963,7 @@ dependencies = [ "wasm-bindgen-futures", "wayland-backend", "wayland-client", - "wayland-protocols", + "wayland-protocols 0.32.3", "wayland-protocols-plasma", "web-sys", "web-time", diff --git a/Cargo.toml b/Cargo.toml index fd9690c603c..2fe3c7c2758 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,9 +95,10 @@ wgpu = { version = "22.0.0", default-features = false, features = [ # Make the renderer `Sync` even on wasm32, because it makes the code simpler: "fragile-send-sync-non-atomic-wasm", ] } +winit = { version = "0.30.5", default-features = false } -# Currently can't upgrade above 0.30.2 due to https://github.com/rust-windowing/winit/issues/3837 -winit = { version = "=0.30.2", default-features = false } +[patch.crates-io] +winit = { git = "https://github.com/rust-windowing/winit.git", branch = "kchibisov/release-0305" } [workspace.lints.rust] unsafe_code = "deny" diff --git a/crates/eframe/src/native/glow_integration.rs b/crates/eframe/src/native/glow_integration.rs index fcec15c35ee..63e631532b1 100644 --- a/crates/eframe/src/native/glow_integration.rs +++ b/crates/eframe/src/native/glow_integration.rs @@ -1114,7 +1114,7 @@ impl GlutinWindowContext { viewport_id, event_loop, Some(window.scale_factor() as f32), - window.theme(), + event_loop.system_theme(), self.max_texture_side, ) }); diff --git a/crates/eframe/src/native/wgpu_integration.rs b/crates/eframe/src/native/wgpu_integration.rs index 2a4fae9532c..4228c52bb5c 100644 --- a/crates/eframe/src/native/wgpu_integration.rs +++ b/crates/eframe/src/native/wgpu_integration.rs @@ -241,7 +241,7 @@ impl WgpuWinitApp { ViewportId::ROOT, event_loop, Some(window.scale_factor() as f32), - window.theme(), + event_loop.system_theme(), painter.max_texture_side(), ); @@ -869,7 +869,7 @@ impl Viewport { viewport_id, event_loop, Some(window.scale_factor() as f32), - window.theme(), + event_loop.system_theme(), painter.max_texture_side(), )); diff --git a/crates/egui_glow/examples/pure_glow.rs b/crates/egui_glow/examples/pure_glow.rs index 9f61a1a72e3..4145e1d6310 100644 --- a/crates/egui_glow/examples/pure_glow.rs +++ b/crates/egui_glow/examples/pure_glow.rs @@ -192,8 +192,7 @@ impl winit::application::ApplicationHandler for GlowApp { let gl = std::sync::Arc::new(gl); gl_window.window().set_visible(true); - let egui_glow = - egui_glow::EguiGlow::new(event_loop, &gl_window.window, gl.clone(), None, None, true); + let egui_glow = egui_glow::EguiGlow::new(event_loop, gl.clone(), None, None, true); let event_loop_proxy = egui::mutex::Mutex::new(self.proxy.clone()); egui_glow diff --git a/crates/egui_glow/src/winit.rs b/crates/egui_glow/src/winit.rs index e297badaf98..c4569015a09 100644 --- a/crates/egui_glow/src/winit.rs +++ b/crates/egui_glow/src/winit.rs @@ -24,7 +24,6 @@ impl EguiGlow { /// For automatic shader version detection set `shader_version` to `None`. pub fn new( event_loop: &winit::event_loop::ActiveEventLoop, - window: &winit::window::Window, gl: std::sync::Arc, shader_version: Option, native_pixels_per_point: Option, @@ -43,7 +42,7 @@ impl EguiGlow { ViewportId::ROOT, event_loop, native_pixels_per_point, - window.theme(), + event_loop.system_theme(), Some(painter.max_texture_side()), ); From b54dd094e702f3a342fa77cdbe4ec0d6d825ff13 Mon Sep 17 00:00:00 2001 From: ArthurBrussee Date: Thu, 8 Aug 2024 19:39:08 +0100 Subject: [PATCH 2/3] Remove patch now that 0.30.5 has landed --- Cargo.lock | 6 ++++-- Cargo.toml | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 22eea32e91d..b8db5cdb00a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1176,7 +1176,8 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dpi" version = "0.1.1" -source = "git+https://github.com/rust-windowing/winit.git?branch=kchibisov/release-0305#95bdaa8bdb8edad3eea5fa11d3d9b0b7f84258ee" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" [[package]] name = "ecolor" @@ -4925,7 +4926,8 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winit" version = "0.30.5" -source = "git+https://github.com/rust-windowing/winit.git?branch=kchibisov/release-0305#95bdaa8bdb8edad3eea5fa11d3d9b0b7f84258ee" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be9e76a1f1077e04a411f0b989cbd3c93339e1771cb41e71ac4aee95bfd2c67" dependencies = [ "ahash", "android-activity", diff --git a/Cargo.toml b/Cargo.toml index 2fe3c7c2758..731ae670ba4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,9 +97,6 @@ wgpu = { version = "22.0.0", default-features = false, features = [ ] } winit = { version = "0.30.5", default-features = false } -[patch.crates-io] -winit = { git = "https://github.com/rust-windowing/winit.git", branch = "kchibisov/release-0305" } - [workspace.lints.rust] unsafe_code = "deny" From 4ec419cbe27fe557ba8e981447d63ea11b3a004c Mon Sep 17 00:00:00 2001 From: ArthurBrussee Date: Thu, 8 Aug 2024 19:42:09 +0100 Subject: [PATCH 3/3] Fix some duplicate dependencies --- Cargo.lock | 104 +++++------------------------------ crates/egui-winit/Cargo.toml | 2 +- 2 files changed, 15 insertions(+), 91 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8db5cdb00a..7c488cec3f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -630,20 +630,6 @@ dependencies = [ "system-deps", ] -[[package]] -name = "calloop" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" -dependencies = [ - "bitflags 2.6.0", - "log", - "polling 3.3.0", - "rustix 0.38.21", - "slab", - "thiserror", -] - [[package]] name = "calloop" version = "0.13.0" @@ -658,25 +644,13 @@ dependencies = [ "thiserror", ] -[[package]] -name = "calloop-wayland-source" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" -dependencies = [ - "calloop 0.12.4", - "rustix 0.38.21", - "wayland-backend", - "wayland-client", -] - [[package]] name = "calloop-wayland-source" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" dependencies = [ - "calloop 0.13.0", + "calloop", "rustix 0.38.21", "wayland-backend", "wayland-client", @@ -3523,7 +3497,7 @@ dependencies = [ "ab_glyph", "log", "memmap2", - "smithay-client-toolkit 0.19.2", + "smithay-client-toolkit", "tiny-skia", ] @@ -3651,31 +3625,6 @@ version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" -[[package]] -name = "smithay-client-toolkit" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" -dependencies = [ - "bitflags 2.6.0", - "calloop 0.12.4", - "calloop-wayland-source 0.2.0", - "cursor-icon", - "libc", - "log", - "memmap2", - "rustix 0.38.21", - "thiserror", - "wayland-backend", - "wayland-client", - "wayland-csd-frame", - "wayland-cursor", - "wayland-protocols 0.31.2", - "wayland-protocols-wlr 0.2.0", - "wayland-scanner", - "xkeysym", -] - [[package]] name = "smithay-client-toolkit" version = "0.19.2" @@ -3683,8 +3632,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ "bitflags 2.6.0", - "calloop 0.13.0", - "calloop-wayland-source 0.3.0", + "calloop", + "calloop-wayland-source", "cursor-icon", "libc", "log", @@ -3695,20 +3644,20 @@ dependencies = [ "wayland-client", "wayland-csd-frame", "wayland-cursor", - "wayland-protocols 0.32.3", - "wayland-protocols-wlr 0.3.3", + "wayland-protocols", + "wayland-protocols-wlr", "wayland-scanner", "xkeysym", ] [[package]] name = "smithay-clipboard" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb62b280ce5a5cba847669933a0948d00904cf83845c944eae96a4738cea1a6" +checksum = "cc8216eec463674a0e90f29e0ae41a4db573ec5b56b1c6c1c71615d249b6d846" dependencies = [ "libc", - "smithay-client-toolkit 0.18.1", + "smithay-client-toolkit", "wayland-backend", ] @@ -4371,18 +4320,6 @@ dependencies = [ "xcursor", ] -[[package]] -name = "wayland-protocols" -version = "0.31.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" -dependencies = [ - "bitflags 2.6.0", - "wayland-backend", - "wayland-client", - "wayland-scanner", -] - [[package]] name = "wayland-protocols" version = "0.32.3" @@ -4404,20 +4341,7 @@ dependencies = [ "bitflags 2.6.0", "wayland-backend", "wayland-client", - "wayland-protocols 0.32.3", - "wayland-scanner", -] - -[[package]] -name = "wayland-protocols-wlr" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" -dependencies = [ - "bitflags 2.6.0", - "wayland-backend", - "wayland-client", - "wayland-protocols 0.31.2", + "wayland-protocols", "wayland-scanner", ] @@ -4430,7 +4354,7 @@ dependencies = [ "bitflags 2.6.0", "wayland-backend", "wayland-client", - "wayland-protocols 0.32.3", + "wayland-protocols", "wayland-scanner", ] @@ -4935,7 +4859,7 @@ dependencies = [ "bitflags 2.6.0", "block2", "bytemuck", - "calloop 0.13.0", + "calloop", "cfg_aliases 0.2.1", "concurrent-queue", "core-foundation", @@ -4957,7 +4881,7 @@ dependencies = [ "redox_syscall 0.4.1", "rustix 0.38.21", "sctk-adwaita", - "smithay-client-toolkit 0.19.2", + "smithay-client-toolkit", "smol_str", "tracing", "unicode-segmentation", @@ -4965,7 +4889,7 @@ dependencies = [ "wasm-bindgen-futures", "wayland-backend", "wayland-client", - "wayland-protocols 0.32.3", + "wayland-protocols", "wayland-protocols-plasma", "web-sys", "web-time", diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index 95e8215b7d9..4060442f6dc 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -80,7 +80,7 @@ serde = { workspace = true, optional = true } webbrowser = { version = "1.0.0", optional = true } [target.'cfg(any(target_os="linux", target_os="dragonfly", target_os="freebsd", target_os="netbsd", target_os="openbsd"))'.dependencies] -smithay-clipboard = { version = "0.7.0", optional = true } +smithay-clipboard = { version = "0.7.2", optional = true } # The wayland-cursor normally selected doesn't properly enable all the features it uses # and thus doesn't compile as it is used in egui-winit. This is fixed upstream, so force