Skip to content

Draft: strawman: add support for constraining resize

Christian Hergert requested to merge wip/chergert/width-and-height-inc into main

compute-size, while aiming to constrain a size, doesn't actually do that at all for situations where you want to keep the window from resizing beyond certain increments.

This particular change to GdkToplevel is enough to be able to implement that in an application by constraining the xdg_toplevel.configure pending size sent from the display server.

We could also keep this in a specific back-end if the portability of it was a concern (Wayland is enough for me).

This is enough to be able to make a GTK 4 based gnome-terminal resize in line increments from application code.

However we might want to give more feedback here so that the caller knows the GdkToplevelState to avoid constraining in maximized/etc scenarios while building up the state. But perhaps the GdkToplevel already has that.

Merge request reports