was_maximized should use pre full screen state as well

This commit is contained in:
Kovid Goyal 2026-09-06 14:50:21 +05:30
parent df2986feb3
commit e55739bd10
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -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++) {