Merge branch 'fix-panel-toggle-fullscreen' of https://github.com/alex-huff/kitty

This commit is contained in:
Kovid Goyal 2025-10-10 07:12:12 +05:30
commit f852ebc3f3
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 15 additions and 12 deletions

5
glfw/x11_window.c vendored
View file

@ -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;

View file

@ -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;
}