Merge pull request #597 from levnikmyskin/main

Support width/height as fractions in window rules. Closes #552
This commit is contained in:
DreamMaoMao 2026-05-12 09:45:27 +08:00 committed by GitHub
commit cb99edd266
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View file

@ -1584,10 +1584,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;