From d837a64e36019e80ad027282822dc0acacf44bbb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 5 Sep 2025 17:25:39 +0530 Subject: [PATCH] Workaround for latest Apple regression in Tahoe Now NSWindow::close no longer actually closes the window. Sigh. Have to also set its frame to zero size, otherwise an invisible rect remains that intercepts mouse events and takes up space in Mission Control. Life is too short for this shit. Fixes #8952 --- docs/changelog.rst | 3 +++ glfw/cocoa_window.m | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 973aed73d..cac05a47d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -171,6 +171,9 @@ Detailed list of changes - macOS: Pass the :kbd:`Cmd+C` shortcut to the application running in the terminal when no text is selected (:pull:`8946`) +- macOS: Workaround for bug in macOS Tahoe that caused closed OS Windows to + remain as invisible rectangles that intercept mouse events (:iss:`8952`) + 0.42.2 [2025-07-16] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 45a52f139..5f44c7cc6 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1927,7 +1927,12 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window) window->ns.view = nil; [window->ns.object removeGLFWWindow]; - [window->ns.object close]; + // Workaround for macOS Tahoe where if the frame is not set to zero size + // even after NSWindow::close the window remains on screen as an invisible + // rectangle that intercepts mouse events and takes up space in mission + // control. Sigh. + [window->ns.object setFrame:NSMakeRect(0, 0, 0, 0) display:NO]; + [window->ns.object close]; // sends a release to the NSWindow so we dont release it here window->ns.object = nil; }