From 9e918547e80bbd9256ec1a24faf7a3b36bb7d917 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 25 Nov 2025 15:38:12 +0530 Subject: [PATCH] Since d7c2cdc closing an OS Window on macOS was causing minimized window to be restored. Fixes #8913 --- docs/changelog.rst | 2 ++ kitty/glfw.c | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 994926b07..427f6d2d7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -171,6 +171,8 @@ Detailed list of changes - When expanding environment variables in :opt:`listen_on` allow the :opt:`env` directive to take effect +- macOS: Fix closing an OS Window when another OS Window is minimized causing + the minimized window to be un-minimized (:iss:`8913`) 0.44.0 [2025-11-03] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/glfw.c b/kitty/glfw.c index 54556a95b..2432fe5dd 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -1587,16 +1587,14 @@ cocoa_focus_last_window(id_type source_window_id, size_t *source_workspaces, siz OSWindow *w = global_state.os_windows + i; if ( w->id != source_window_id && w->handle && w->shown_once && - w->last_focused_counter >= highest_focus_number && + w->last_focused_counter >= highest_focus_number && !glfwGetWindowAttrib(w->handle, GLFW_ICONIFIED) && (!source_workspace_count || window_in_same_cocoa_workspace(glfwGetCocoaWindow(w->handle), source_workspaces, source_workspace_count)) ) { highest_focus_number = w->last_focused_counter; window_to_focus = w; } } - if (window_to_focus) { - glfwFocusWindow(window_to_focus->handle); - } + if (window_to_focus) glfwFocusWindow(window_to_focus->handle); } #endif