From fd25fde5bc353bdb3486a94f2a741eb3f3f36d6a Mon Sep 17 00:00:00 2001 From: PastaClaw Date: Wed, 25 Feb 2026 10:43:42 -0600 Subject: [PATCH 1/4] fix: use wgpu renderer to prevent OpenGL idle crashes Switch from glow (OpenGL) to wgpu renderer on all platforms to avoid platform-specific rendering issues such as EXC_BAD_ACCESS crashes in NSOpenGLContext during idle/sleep/display changes on macOS. Closes #629 --- Cargo.lock | 2 ++ Cargo.toml | 2 +- src/main.rs | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a353129fb..19ee00778 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2491,6 +2491,7 @@ dependencies = [ "objc2-foundation 0.2.2", "parking_lot", "percent-encoding", + "pollster", "profiling", "raw-window-handle", "ron", @@ -2500,6 +2501,7 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "web-time", + "wgpu", "windows-sys 0.61.2", "winit", ] diff --git a/Cargo.toml b/Cargo.toml index 1ed4b5f8e..668cd386c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ egui_commonmark = "0.22.0" rfd = "0.17.2" qrcode = "0.14.1" nix = { version = "0.31.1", features = ["signal"] } -eframe = { version = "0.33.3", features = ["persistence"] } +eframe = { version = "0.33.3", features = ["persistence", "wgpu"] } base64 = "0.22.1" dash-sdk = { git = "https://github.com/dashpay/platform", rev = "0fa82e6652097d17a700d8bcc006d6b2aa922c6e", features = [ "core_key_wallet", diff --git a/src/main.rs b/src/main.rs index c5a65f6c1..50cb0b283 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,7 +48,7 @@ async fn start(app_data_dir: &std::path::Path) -> Result<(), eframe::Error> { // Load icon for the window let icon_data = load_icon(); - let native_options = eframe::NativeOptions { + let mut native_options = eframe::NativeOptions { persist_window: true, // Persist window size and position centered: true, // Center window on startup if not maximized persistence_path: Some(app_data_dir.join("app.ron")), @@ -58,6 +58,10 @@ async fn start(app_data_dir: &std::path::Path) -> Result<(), eframe::Error> { ..Default::default() }; + // Use wgpu instead of glow (OpenGL) to avoid platform-specific rendering + // issues, e.g. NSOpenGLContext idle/sleep crashes on macOS (#629) + native_options.renderer = eframe::Renderer::Wgpu; + eframe::run_native( &format!("Dash Evo Tool v{}", VERSION), native_options, From d9b9b4b353ff0c423d26926c27e76b3ebd2461a5 Mon Sep 17 00:00:00 2001 From: PastaClaw Date: Thu, 26 Feb 2026 09:40:12 -0600 Subject: [PATCH 2/4] fix: guard wgpu renderer to macOS only The NSOpenGLContext idle/sleep crash (#629) is macOS-specific, so only switch to the wgpu renderer on macOS. Other platforms keep the default glow (OpenGL) renderer, avoiding unnecessary dependency overhead. --- Cargo.toml | 5 ++++- src/main.rs | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 668cd386c..00706329d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ egui_commonmark = "0.22.0" rfd = "0.17.2" qrcode = "0.14.1" nix = { version = "0.31.1", features = ["signal"] } -eframe = { version = "0.33.3", features = ["persistence", "wgpu"] } +eframe = { version = "0.33.3", features = ["persistence"] } base64 = "0.22.1" dash-sdk = { git = "https://github.com/dashpay/platform", rev = "0fa82e6652097d17a700d8bcc006d6b2aa922c6e", features = [ "core_key_wallet", @@ -81,6 +81,9 @@ zmq = "0.10.0" [target.'cfg(target_os = "windows")'.dependencies] zeromq = "0.4.1" +[target.'cfg(target_os = "macos")'.dependencies] +eframe = { version = "0.33.3", features = ["persistence", "wgpu"] } + [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] native-dialog = "0.9.0" raw-cpuid = "11.5.0" diff --git a/src/main.rs b/src/main.rs index 50cb0b283..30e3e7221 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,6 +48,7 @@ async fn start(app_data_dir: &std::path::Path) -> Result<(), eframe::Error> { // Load icon for the window let icon_data = load_icon(); + #[allow(unused_mut)] let mut native_options = eframe::NativeOptions { persist_window: true, // Persist window size and position centered: true, // Center window on startup if not maximized @@ -58,9 +59,12 @@ async fn start(app_data_dir: &std::path::Path) -> Result<(), eframe::Error> { ..Default::default() }; - // Use wgpu instead of glow (OpenGL) to avoid platform-specific rendering - // issues, e.g. NSOpenGLContext idle/sleep crashes on macOS (#629) - native_options.renderer = eframe::Renderer::Wgpu; + // Use wgpu instead of glow (OpenGL) on macOS to avoid NSOpenGLContext + // idle/sleep crashes (#629). Other platforms keep the default glow renderer. + #[cfg(target_os = "macos")] + { + native_options.renderer = eframe::Renderer::Wgpu; + } eframe::run_native( &format!("Dash Evo Tool v{}", VERSION), From 6bbf8341dbc0fd5629baa656b0f5f53989f699a1 Mon Sep 17 00:00:00 2001 From: PastaClaw Date: Thu, 26 Feb 2026 09:51:13 -0600 Subject: [PATCH 3/4] refactor: set wgpu renderer inline via cfg instead of allow(unused_mut) --- src/main.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 30e3e7221..4dd9ff97d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,24 +48,20 @@ async fn start(app_data_dir: &std::path::Path) -> Result<(), eframe::Error> { // Load icon for the window let icon_data = load_icon(); - #[allow(unused_mut)] - let mut native_options = eframe::NativeOptions { + let native_options = eframe::NativeOptions { persist_window: true, // Persist window size and position centered: true, // Center window on startup if not maximized persistence_path: Some(app_data_dir.join("app.ron")), viewport: egui::ViewportBuilder::default() .with_icon(icon_data) .with_app_id("org.dash.DashEvoTool"), + // Use wgpu instead of glow (OpenGL) on macOS to avoid NSOpenGLContext + // idle/sleep crashes (#629). Other platforms keep the default glow renderer. + #[cfg(target_os = "macos")] + renderer: eframe::Renderer::Wgpu, ..Default::default() }; - // Use wgpu instead of glow (OpenGL) on macOS to avoid NSOpenGLContext - // idle/sleep crashes (#629). Other platforms keep the default glow renderer. - #[cfg(target_os = "macos")] - { - native_options.renderer = eframe::Renderer::Wgpu; - } - eframe::run_native( &format!("Dash Evo Tool v{}", VERSION), native_options, From 7fdafcf0c180d1f8af1b6b37014592f69744eb95 Mon Sep 17 00:00:00 2001 From: PastaClaw Date: Thu, 26 Feb 2026 09:59:12 -0600 Subject: [PATCH 4/4] refactor: use wgpu renderer unconditionally on all platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove macOS-only cfg guard — wgpu is now the renderer for all platforms, not just macOS. --- Cargo.toml | 5 +---- src/main.rs | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00706329d..668cd386c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ egui_commonmark = "0.22.0" rfd = "0.17.2" qrcode = "0.14.1" nix = { version = "0.31.1", features = ["signal"] } -eframe = { version = "0.33.3", features = ["persistence"] } +eframe = { version = "0.33.3", features = ["persistence", "wgpu"] } base64 = "0.22.1" dash-sdk = { git = "https://github.com/dashpay/platform", rev = "0fa82e6652097d17a700d8bcc006d6b2aa922c6e", features = [ "core_key_wallet", @@ -81,9 +81,6 @@ zmq = "0.10.0" [target.'cfg(target_os = "windows")'.dependencies] zeromq = "0.4.1" -[target.'cfg(target_os = "macos")'.dependencies] -eframe = { version = "0.33.3", features = ["persistence", "wgpu"] } - [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] native-dialog = "0.9.0" raw-cpuid = "11.5.0" diff --git a/src/main.rs b/src/main.rs index 4dd9ff97d..5c07da0a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,9 +55,8 @@ async fn start(app_data_dir: &std::path::Path) -> Result<(), eframe::Error> { viewport: egui::ViewportBuilder::default() .with_icon(icon_data) .with_app_id("org.dash.DashEvoTool"), - // Use wgpu instead of glow (OpenGL) on macOS to avoid NSOpenGLContext - // idle/sleep crashes (#629). Other platforms keep the default glow renderer. - #[cfg(target_os = "macos")] + // Use wgpu instead of glow (OpenGL) to avoid platform-specific rendering + // issues, e.g. NSOpenGLContext idle/sleep crashes on macOS (#629) renderer: eframe::Renderer::Wgpu, ..Default::default() };