From 4813571666ef111ce9fddb9ef8abc6b98e295cd4 Mon Sep 17 00:00:00 2001 From: lucasmerlin Date: Wed, 9 Jul 2025 12:40:46 +0200 Subject: [PATCH] Don't restore window settings if they were fullscreen on macos --- crates/egui-winit/src/window_settings.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/egui-winit/src/window_settings.rs b/crates/egui-winit/src/window_settings.rs index d15712d4c..6592a39f8 100644 --- a/crates/egui-winit/src/window_settings.rs +++ b/crates/egui-winit/src/window_settings.rs @@ -60,6 +60,13 @@ impl WindowSettings { mut viewport_builder: ViewportBuilder, ) -> ViewportBuilder { profiling::function_scope!(); + // On MacOS with an external monitor, if the window starts fullscreen, + // the top area is not clickable. See https://github.com/rust-windowing/winit/issues/4295 + let top_area_not_clickable_workaround = + cfg!(target_os = "macos") && !cfg!(feature = "accesskit"); + if top_area_not_clickable_workaround && self.fullscreen { + return viewport_builder; + } // `WindowBuilder::with_position` expects inner position in Macos, and outer position elsewhere // See [`winit::window::WindowBuilder::with_position`] for details.