From 27a22f991d9b747e031e7ffd274594facdda2a3a Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Sat, 11 May 2024 07:41:02 +0900 Subject: [PATCH] Fix : In Windows, the 'egui_demo_app' screen does not appear. (#4410) * Related #4337 * Closes #4409 Fix : In Windows, the 'egui_demo_app' screen does not appear After the #4337 update. --------- Co-authored-by: Emil Ernerfeldt --- crates/eframe/src/native/epi_integration.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/eframe/src/native/epi_integration.rs b/crates/eframe/src/native/epi_integration.rs index b09f0f0e..a8208a14 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -20,10 +20,9 @@ pub fn viewport_builder( let mut viewport_builder = native_options.viewport.clone(); - let clamp_size_to_monitor_size = viewport_builder.clamp_size_to_monitor_size.unwrap_or( - // On some Linux systems, a window size larger than the monitor causes crashes - cfg!(target_os = "linux"), - ); + // On some Linux systems, a window size larger than the monitor causes crashes, + // and on Windows the window does not appear at all. + let clamp_size_to_monitor_size = viewport_builder.clamp_size_to_monitor_size.unwrap_or(true); // Always use the default window size / position on iOS. Trying to restore the previous position // causes the window to be shown too small.