From 0d2f6cf4e686462a307eddd2043948039d8437b3 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 23 Mar 2026 18:53:32 +0100 Subject: [PATCH] Reduce warning level on occluded error --- crates/egui-wgpu/src/lib.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/crates/egui-wgpu/src/lib.rs b/crates/egui-wgpu/src/lib.rs index 05936d6cd..eb04173b5 100644 --- a/crates/egui-wgpu/src/lib.rs +++ b/crates/egui-wgpu/src/lib.rs @@ -348,13 +348,21 @@ impl Default for WgpuConfiguration { // `WgpuSetup::from_display_handle(...)` before creating the instance if one is available. wgpu_setup: WgpuSetup::without_display_handle(), on_surface_status: Arc::new(|status| { - if matches!(status, wgpu::CurrentSurfaceTexture::Outdated) { - // This error occurs when the app is minimized on Windows. - // Silently return here to prevent spamming the console with: - // "The underlying surface has changed, and therefore the swap chain must be updated" - } else { - log::warn!("Dropped frame with error: {status:?}"); + match status { + wgpu::CurrentSurfaceTexture::Outdated => { + // This error occurs when the app is minimized on Windows. + // Silently return here to prevent spamming the console with: + // "The underlying surface has changed, and therefore the swap chain must be updated" + } + wgpu::CurrentSurfaceTexture::Occluded => { + // This error occurs when the application is occluded (e.g. minimized or behind another window). + log::debug!("Dropped frame with error: {status:?}"); + } + _ => { + log::warn!("Dropped frame with error: {status:?}"); + } } + SurfaceErrorAction::SkipFrame }), }