From 5e439302cfcdc207da094e27e4ce1d8358ccd50d Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:51:39 +0900 Subject: [PATCH 1/3] Update epi_integration.rs --- crates/eframe/src/native/epi_integration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/eframe/src/native/epi_integration.rs b/crates/eframe/src/native/epi_integration.rs index b09f0f0e0c79..efcb6840b114 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -20,9 +20,9 @@ pub fn viewport_builder( let mut viewport_builder = native_options.viewport.clone(); + // On some Linux systems, a window size larger than the monitor causes crashes 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"), + true, ); // Always use the default window size / position on iOS. Trying to restore the previous position From 3cdb98b57c0dabf35ab8ce6618b21e0aa2a37f18 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:56:47 +0900 Subject: [PATCH 2/3] Update epi_integration.rs --- crates/eframe/src/native/epi_integration.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/eframe/src/native/epi_integration.rs b/crates/eframe/src/native/epi_integration.rs index efcb6840b114..b0408671b3f2 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -21,9 +21,7 @@ pub fn viewport_builder( let mut viewport_builder = native_options.viewport.clone(); // On some Linux systems, a window size larger than the monitor causes crashes - let clamp_size_to_monitor_size = viewport_builder.clamp_size_to_monitor_size.unwrap_or( - true, - ); + 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. From 8bc0585dfda04f3587c075c1a43d64fde3cd235d Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 11 May 2024 00:32:20 +0200 Subject: [PATCH 3/3] improve comment --- crates/eframe/src/native/epi_integration.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/eframe/src/native/epi_integration.rs b/crates/eframe/src/native/epi_integration.rs index b0408671b3f2..a8208a147ca0 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -20,7 +20,8 @@ pub fn viewport_builder( let mut viewport_builder = native_options.viewport.clone(); - // On some Linux systems, a window size larger than the monitor causes crashes + // 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