don't respect size hints for fullscreen clients

Fixes: #292
This commit is contained in:
Leonardo Hernández Hernández 2022-08-16 20:57:09 -05:00
parent 7a343b98cf
commit a7f77160d1
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

20
dwl.c
View File

@ -383,15 +383,17 @@ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
void void
applybounds(Client *c, struct wlr_box *bbox) applybounds(Client *c, struct wlr_box *bbox)
{ {
struct wlr_box min = {0}, max = {0}; if (!c->isfullscreen) {
client_get_size_hints(c, &max, &min); struct wlr_box min = {0}, max = {0};
/* try to set size hints */ client_get_size_hints(c, &max, &min);
c->geom.width = MAX(min.width + (2 * c->bw), c->geom.width); /* try to set size hints */
c->geom.height = MAX(min.height + (2 * c->bw), c->geom.height); c->geom.width = MAX(min.width + (2 * c->bw), c->geom.width);
if (max.width > 0 && !(2 * c->bw > INT_MAX - max.width)) // Checks for overflow c->geom.height = MAX(min.height + (2 * c->bw), c->geom.height);
c->geom.width = MIN(max.width + (2 * c->bw), c->geom.width); if (max.width > 0 && !(2 * c->bw > INT_MAX - max.width)) // Checks for overflow
if (max.height > 0 && !(2 * c->bw > INT_MAX - max.height)) // Checks for overflow c->geom.width = MIN(max.width + (2 * c->bw), c->geom.width);
c->geom.height = MIN(max.height + (2 * c->bw), c->geom.height); if (max.height > 0 && !(2 * c->bw > INT_MAX - max.height)) // Checks for overflow
c->geom.height = MIN(max.height + (2 * c->bw), c->geom.height);
}
if (c->geom.x >= bbox->x + bbox->width) if (c->geom.x >= bbox->x + bbox->width)
c->geom.x = bbox->x + bbox->width - c->geom.width; c->geom.x = bbox->x + bbox->width - c->geom.width;