diff --git a/docs/changelog.rst b/docs/changelog.rst index 5b2a0a788..8572e8010 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -144,6 +144,10 @@ Detailed list of changes - Fix a regression in the previous release that caused the incorrect tab to be active when loading a session (:iss:`9025`) +- macOS: Workaround for bug in macOS Tahoe that caused closed OS Windows to + remain as invisible rectangles that intercept mouse events (:iss:`8952`) + + 0.43.0 [2025-09-28] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -215,9 +219,6 @@ 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`) - - macOS: Workaround for bug in macOS Tahoe that caused OS Windows that are fullscreen on a monitor that is disconnected while macOS is asleep to crash kitty (:iss:`8983`) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 395b5125c..8934c0d87 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1929,10 +1929,11 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconf void _glfwPlatformDestroyWindow(_GLFWwindow* window) { + NSWindow *w = window->ns.object; if (_glfw.ns.disabledCursorWindow == window) _glfw.ns.disabledCursorWindow = NULL; - [window->ns.object orderOut:nil]; + [w orderOut:nil]; if (window->monitor) releaseMonitor(window); @@ -1940,7 +1941,7 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window) if (window->context.destroy) window->context.destroy(window); - [window->ns.object setDelegate:nil]; + [w setDelegate:nil]; [window->ns.delegate cleanup]; [window->ns.delegate release]; window->ns.delegate = nil; @@ -1950,7 +1951,13 @@ 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. + NSRect frame = w.frame; frame.size.width = 0; frame.size.height = 0; + [w setFrame:frame display:NO]; + [w close]; // sends a release to NSWindow so we dont release it window->ns.object = nil; }