opt: suppor mfact in deck layout

This commit is contained in:
DreamMaoMao 2025-05-11 21:42:10 +08:00
parent 90109a3512
commit 0a79024da8

View file

@ -6329,9 +6329,12 @@ deck(Monitor *m)
if (n == 0)
return;
// Calculate master width using mfact from pertag
float mfact = m->pertag ? m->pertag->mfacts[m->pertag->curtag] : m->mfact;
// Calculate master width including outer gaps
if (n > m->nmaster)
mw = m->nmaster ? round((m->w.width - 2 * cur_gappoh) * m->mfact) : 0;
mw = m->nmaster ? round((m->w.width - 2 * cur_gappoh) * mfact) : 0;
else
mw = m->w.width - 2 * cur_gappoh;