mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-17 05:33:52 -04:00
render: resize: call xdg_toplevel_set_min_size()
This is a hint to the compositor, not to set a smaller size than this.
This commit is contained in:
parent
8a849b4b08
commit
514fcc20a7
2 changed files with 9 additions and 9 deletions
|
|
@ -125,6 +125,7 @@
|
||||||
into the double-width glyph ([#1256][1256]).
|
into the double-width glyph ([#1256][1256]).
|
||||||
* Wayland protocol violation when ack:ing a configure event for an
|
* Wayland protocol violation when ack:ing a configure event for an
|
||||||
unmapped surface ([#1249][1249]).
|
unmapped surface ([#1249][1249]).
|
||||||
|
* `xdg\_toplevel::set_min_size()` not being called.
|
||||||
|
|
||||||
[1173]: https://codeberg.org/dnkl/foot/issues/1173
|
[1173]: https://codeberg.org/dnkl/foot/issues/1173
|
||||||
[1190]: https://codeberg.org/dnkl/foot/issues/1190
|
[1190]: https://codeberg.org/dnkl/foot/issues/1190
|
||||||
|
|
|
||||||
17
render.c
17
render.c
|
|
@ -3885,9 +3885,9 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
|
||||||
const int min_cols = 2;
|
const int min_cols = 2;
|
||||||
const int min_rows = 1;
|
const int min_rows = 1;
|
||||||
|
|
||||||
/* Minimum window size */
|
/* Minimum window size (must be divisible by the scaling factor)*/
|
||||||
const int min_width = min_cols * term->cell_width;
|
const int min_width = (min_cols * term->cell_width + scale - 1) / scale * scale;
|
||||||
const int min_height = min_rows * term->cell_height;
|
const int min_height = (min_rows * term->cell_height + scale - 1) / scale * scale;
|
||||||
|
|
||||||
width = max(width, min_width);
|
width = max(width, min_width);
|
||||||
height = max(height, min_height);
|
height = max(height, min_height);
|
||||||
|
|
@ -4132,12 +4132,6 @@ damage_view:
|
||||||
term->stashed_height = term->height;
|
term->stashed_height = term->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* TODO: doesn't include CSD title bar */
|
|
||||||
xdg_toplevel_set_min_size(
|
|
||||||
term->window->xdg_toplevel, min_width / scale, min_height / scale);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const bool title_shown = wayl_win_csd_titlebar_visible(term->window);
|
const bool title_shown = wayl_win_csd_titlebar_visible(term->window);
|
||||||
const bool border_shown = wayl_win_csd_borders_visible(term->window);
|
const bool border_shown = wayl_win_csd_borders_visible(term->window);
|
||||||
|
|
@ -4147,6 +4141,11 @@ damage_view:
|
||||||
const int border_width =
|
const int border_width =
|
||||||
border_shown ? term->conf->csd.border_width_visible : 0;
|
border_shown ? term->conf->csd.border_width_visible : 0;
|
||||||
|
|
||||||
|
xdg_toplevel_set_min_size(
|
||||||
|
term->window->xdg_toplevel,
|
||||||
|
min_width / scale + 2 * border_width,
|
||||||
|
min_height / scale + title_height + 2 * border_width);
|
||||||
|
|
||||||
xdg_surface_set_window_geometry(
|
xdg_surface_set_window_geometry(
|
||||||
term->window->xdg_surface,
|
term->window->xdg_surface,
|
||||||
-border_width,
|
-border_width,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue