diff --git a/glfw/x11_window.c b/glfw/x11_window.c index 2b1f1be4a..65257674e 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -607,6 +607,11 @@ calculate_layer_geometry(_GLFWwindow *window) { ans.width = m.width - config.requested_right_margin - config.requested_left_margin; ans.struts[s.bottom] = ans.height; ans.struts[s.bottom_end_x] = ans.width; break; + case GLFW_EDGE_NONE: + ans.needs_strut = false; + ans.x = m.x + config.requested_left_margin; + ans.y = m.y + config.requested_top_margin; + break; case GLFW_EDGE_CENTER_SIZED: ans.needs_strut = false; ans.x = (m.width - ans.width) / 2; diff --git a/kitty/glfw.c b/kitty/glfw.c index ff781e240..5f5a2a359 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -1025,18 +1025,16 @@ toggle_fullscreen_for_os_window(OSWindow *w) { glfwSetLayerShellConfig(w->handle, &lsc); return true; } - if (prev->edge == GLFW_EDGE_TOP || prev->edge == GLFW_EDGE_BOTTOM || prev->edge == GLFW_EDGE_LEFT || prev->edge == GLFW_EDGE_RIGHT) { - lsc.edge = GLFW_EDGE_CENTER; - lsc.previous.edge = prev->edge; - lsc.previous.requested_right_margin = prev->requested_right_margin; - lsc.previous.requested_left_margin = prev->requested_left_margin; - lsc.previous.requested_top_margin = prev->requested_top_margin; - lsc.previous.requested_bottom_margin = prev->requested_bottom_margin; - lsc.requested_bottom_margin = 0; lsc.requested_top_margin = 0; lsc.requested_left_margin = 0; lsc.requested_right_margin = 0; - lsc.was_toggled_to_fullscreen = true; - glfwSetLayerShellConfig(w->handle, &lsc); - return true; - } + lsc.edge = GLFW_EDGE_CENTER; + lsc.previous.edge = prev->edge; + lsc.previous.requested_right_margin = prev->requested_right_margin; + lsc.previous.requested_left_margin = prev->requested_left_margin; + lsc.previous.requested_top_margin = prev->requested_top_margin; + lsc.previous.requested_bottom_margin = prev->requested_bottom_margin; + lsc.requested_bottom_margin = 0; lsc.requested_top_margin = 0; lsc.requested_left_margin = 0; lsc.requested_right_margin = 0; + lsc.was_toggled_to_fullscreen = true; + glfwSetLayerShellConfig(w->handle, &lsc); + return true; } return false; }