mirror of
https://codeberg.org/FabricSoul/dwl.git
synced 2025-08-03 20:10:23 -04:00
do not allow set client size less than its min size
This commit is contained in:
parent
467123dc99
commit
475c134144
2 changed files with 24 additions and 2 deletions
20
client.h
20
client.h
|
@ -179,3 +179,23 @@ client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
|
|||
#endif
|
||||
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_min_size(Client *c, int *width, int *height)
|
||||
{
|
||||
struct wlr_xdg_toplevel *toplevel;
|
||||
struct wlr_xdg_toplevel_state *state;
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
struct wlr_xwayland_surface_size_hints *size_hints;
|
||||
size_hints = c->surface.xwayland->size_hints;
|
||||
*width = size_hints->min_width;
|
||||
*height = size_hints->min_height;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
toplevel = c->surface.xdg->toplevel;
|
||||
state = &toplevel->current;
|
||||
*width = state->min_width;
|
||||
*height = state->min_height;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue