From e55739bd1046fad7918955701fa13170334babe6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Sep 2026 14:50:21 +0530 Subject: [PATCH] was_maximized should use pre full screen state as well --- kitty/child-monitor.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index 4d0a76b53..6ac645b38 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -1374,7 +1374,13 @@ close_os_window(ChildMonitor *self, OSWindow *os_window) { if (os_window->handle && !global_state.is_wayland) glfwGetWindowPos(os_window->handle, &x, &y); bool is_layer_shell = os_window->is_layer_shell; bool was_maximized = false; - if (os_window->handle && !is_layer_shell) { was_maximized = glfwGetWindowAttrib(os_window->handle, GLFW_MAXIMIZED) != 0; } + if (os_window->handle && !is_layer_shell) { + if (os_window->before_fullscreen.is_set && is_os_window_fullscreen(os_window)) { + was_maximized = os_window->before_fullscreen.was_maximized; + } else { + was_maximized = glfwGetWindowAttrib(os_window->handle, GLFW_MAXIMIZED) != 0; + } + } destroy_os_window(os_window); call_boss(on_os_window_closed, "KiiiiOO", os_window->id, x, y, w, h, was_maximized ? Py_True : Py_False, is_layer_shell ? Py_True : Py_False); for (size_t t = 0; t < os_window->num_tabs; t++) {