Skip to content

Commit

Permalink
Fix resize_in_steps for Wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
Murnto committed Dec 2, 2024
1 parent 463f17f commit a058b50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 8 additions & 3 deletions glfw/wl_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,14 @@ xdgToplevelHandleConfigure(void* data,
}
debug("\n");
if (new_states & TOPLEVEL_STATE_RESIZING) {
if (width) window->wl.user_requested_content_size.width = width;
if (height) window->wl.user_requested_content_size.height = height;
if (width) {
if (window->widthincr != GLFW_DONT_CARE) width = width / window->widthincr * window->widthincr;
window->wl.user_requested_content_size.width = width;
}
if (height) {
if (window->heightincr != GLFW_DONT_CARE) height = height / window->heightincr * window->heightincr;
window->wl.user_requested_content_size.height = height;
}
if (!(window->wl.current.toplevel_states & TOPLEVEL_STATE_RESIZING)) report_live_resize(window, true);
}
if (width != 0 && height != 0)
Expand Down Expand Up @@ -1529,7 +1535,6 @@ void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window UNUSED,
void _glfwPlatformSetWindowSizeIncrements(_GLFWwindow* window UNUSED,
int widthincr UNUSED, int heightincr UNUSED)
{
// TODO: find out how to trigger a resize.
// The actual limits are checked in the xdg_toplevel::configure handler.
}

Expand Down
3 changes: 1 addition & 2 deletions kitty/options/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,8 +1245,7 @@
Resize the OS window in steps as large as the cells, instead of with the usual
pixel accuracy. Combined with :opt:`initial_window_width` and
:opt:`initial_window_height` in number of cells, this option can be used to keep
the margins as small as possible when resizing the OS window. Note that this
does not currently work on Wayland.
the margins as small as possible when resizing the OS window.
'''
)

Expand Down

0 comments on commit a058b50

Please sign in to comment.