always apply a minimum size of 1x1

Resizing with the mouse can make the size negative, which makes dwl
crash, and the minimum is 1 because 0 makes some X11 clients crash.
This commit is contained in:
save196
2026-09-18 10:37:27 +02:00
committed by Guido Cella
parent 669b26d0a9
commit 45054a34a4
+4
View File
@@ -488,6 +488,10 @@ static struct wlr_xwayland *xwayland;
void void
applybounds(Client *c, struct wlr_box *bbox) applybounds(Client *c, struct wlr_box *bbox)
{ {
/* set minimum client size to 1 */
c->geom.width = MAX(1 + 2 * (int)c->bw, c->geom.width);
c->geom.height = MAX(1 + 2 * (int)c->bw, c->geom.height);
if (!c->isfullscreen) { if (!c->isfullscreen) {
struct wlr_box min = {0}, max = {0}; struct wlr_box min = {0}, max = {0};
client_get_size_hints(c, &max, &min); client_get_size_hints(c, &max, &min);