From d3c5cb12c4dc3d9fdf2a3050bd1ec9264ef761c9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 7 Oct 2025 08:57:57 +0530 Subject: [PATCH] macOS: Dont do live resizing when window is fullscreen The live resize causes crashes on some Tahoe machines due to macOS bugs. It is not needed anyway when the window is fullscreen, so ignore it. --- glfw/cocoa_window.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 5380d88b0..29103efa6 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -567,7 +567,12 @@ - (void)windowDidResize:(NSNotification *)notification NSArray *currentScreenStates = [self captureScreenStates]; const bool is_screen_change = ![_lastScreenStates isEqualToArray:currentScreenStates]; const bool is_main_thread = [NSThread isMainThread]; - debug_rendering("windowDidResize() called, is_screen_change: %d is_main_thread: %d\n", is_screen_change, is_main_thread); + NSWindowStyleMask sm = [window->ns.object styleMask]; + const bool is_fullscreen = (sm & NSWindowStyleMaskFullScreen) != 0; + NSRect frame = [window->ns.object frame]; + debug_rendering( + "windowDidResize() called, is_screen_change: %d is_main_thread: %d is_fullscreen: %d frame: %.1fx%.1f@(%.1f, %.1f)\n", + is_screen_change, is_main_thread, is_fullscreen, frame.size.width, frame.size.height, frame.origin.x, frame.origin.y); if (is_screen_change) { // This resize likely happened because a screen was added, removed, or changed resolution. [_lastScreenStates release]; @@ -609,7 +614,7 @@ - (void)windowDidResize:(NSNotification *)notification // Because of a bug in macOS Tahoe we cannot redraw the window in response // to a resize event that was caused by a screen change as the OpenGL // context is not ready yet. See: https://github.com/kovidgoyal/kitty/issues/8983 - if (window->ns.resizeCallback && !is_screen_change && is_main_thread) window->ns.resizeCallback((GLFWwindow*)window); + if (window->ns.resizeCallback && !is_screen_change && !is_fullscreen && is_main_thread) window->ns.resizeCallback((GLFWwindow*)window); } - (void)windowDidMove:(NSNotification *)notification