From 3ca953d98e28d428649d6190d7569ec0ba93188d Mon Sep 17 00:00:00 2001 From: alex-huff Date: Thu, 9 Oct 2025 16:46:44 -0500 Subject: [PATCH 1/2] panel: allow toggling fullscreen regardless of edge --- kitty/glfw.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) 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; } From 1967fd9dd5a9b96ca725cbb1b4822598f3208c56 Mon Sep 17 00:00:00 2001 From: alex-huff Date: Thu, 9 Oct 2025 17:18:40 -0500 Subject: [PATCH 2/2] panel: implemented --edge=none on X11 --- glfw/x11_window.c | 5 +++++ 1 file changed, 5 insertions(+) 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;