feat(window_rule): support width/height as fractions in window rules.

This commit is contained in:
Alessio Molinari 2026-01-21 22:09:14 +01:00 committed by DreamMaoMao
parent 49921eadfa
commit a25e2a9b1c
2 changed files with 10 additions and 6 deletions

View file

@ -1360,10 +1360,14 @@ void applyrules(Client *c) {
// set geometry of floating client
if (r->width > 0)
if (r->width > 1)
c->float_geom.width = r->width;
if (r->height > 0)
else if (r->width > 0 && r->width <= 1)
c->float_geom.width = round(mon->m.width * r->width);
if (r->height > 1)
c->float_geom.height = r->height;
else if (r->height > 0 && r->height <= 1)
c->float_geom.height = round(mon->m.height * r->height);
if (r->width > 0 || r->height > 0) {
c->iscustomsize = 1;