macOS: Fix closing an OS Window when another OS Window is minimized causing the minimized window to be un-minimized

This is a bug we inherited from GLFW.
Fixes #8913
This commit is contained in:
Kovid Goyal
2025-08-18 21:26:54 +05:30
parent 3638adda6c
commit d7c2cdccb1
2 changed files with 7 additions and 2 deletions

View File

@@ -145,6 +145,9 @@ Detailed list of changes
it was last active on, after full screening some application causes the quick it was last active on, after full screening some application causes the quick
access terminal to appear on the old space (:iss:`8740`) access terminal to appear on the old space (:iss:`8740`)
- macOS: Fix closing an OS Window when another OS Window is minimized causing
the minimized window to be un-minimized (:iss:`8913`)
- Allow using backspace to move the cursor onto the previous line in cooked mode. This is indicated by the `bw` property in kitty's terminfo (:iss:`8841`) - Allow using backspace to move the cursor onto the previous line in cooked mode. This is indicated by the `bw` property in kitty's terminfo (:iss:`8841`)
- Watchers: A new event for global watchers corresponding to the tab bar being changed (:disc:`8842`) - Watchers: A new event for global watchers corresponding to the tab bar being changed (:disc:`8842`)

View File

@@ -1667,7 +1667,8 @@ handle_screen_size_change(_GLFWwindow *window, NSNotification *notification UNUS
- (BOOL)canBecomeKeyWindow - (BOOL)canBecomeKeyWindow
{ {
if (glfw_window && glfw_window->ns.layer_shell.is_active) { if (!glfw_window) return NO;
if (glfw_window->ns.layer_shell.is_active) {
if (glfw_window->ns.layer_shell.config.type == GLFW_LAYER_SHELL_BACKGROUND) return NO; if (glfw_window->ns.layer_shell.config.type == GLFW_LAYER_SHELL_BACKGROUND) return NO;
switch(glfw_window->ns.layer_shell.config.focus_policy) { switch(glfw_window->ns.layer_shell.config.focus_policy) {
case GLFW_FOCUS_NOT_ALLOWED: return NO; case GLFW_FOCUS_NOT_ALLOWED: return NO;
@@ -1676,7 +1677,8 @@ handle_screen_size_change(_GLFWwindow *window, NSNotification *notification UNUS
} }
} }
// Required for NSWindowStyleMaskBorderless windows // Required for NSWindowStyleMaskBorderless windows
return YES; // Also miniaturized windows should not become key
return !_glfwPlatformWindowIconified(glfw_window);
} }
- (BOOL)canBecomeMainWindow - (BOOL)canBecomeMainWindow