mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-06 07:15:53 -04:00
修复master数量和比例不固化
This commit is contained in:
parent
f2f2bdceb3
commit
f90f6f35bc
1 changed files with 10 additions and 19 deletions
29
main.c
29
main.c
|
|
@ -1868,8 +1868,8 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
m->is_in_hotarea = 0;
|
m->is_in_hotarea = 0;
|
||||||
m->tagset[0] = m->tagset[1] = 1;
|
m->tagset[0] = m->tagset[1] = 1;
|
||||||
float scale = 1;
|
float scale = 1;
|
||||||
m->mfact = 0.5;
|
m->mfact = default_mfact;
|
||||||
m->nmaster = 1;
|
m->nmaster = default_nmaster;
|
||||||
enum wl_output_transform rr = WL_OUTPUT_TRANSFORM_NORMAL;
|
enum wl_output_transform rr = WL_OUTPUT_TRANSFORM_NORMAL;
|
||||||
|
|
||||||
if(LENGTH(layouts) > 1){
|
if(LENGTH(layouts) > 1){
|
||||||
|
|
@ -2605,7 +2605,7 @@ incnmaster(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (!arg || !selmon)
|
if (!arg || !selmon)
|
||||||
return;
|
return;
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
|
selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->pertag->nmasters[selmon->pertag->curtag] + arg->i, 0);
|
||||||
arrange(selmon,false);
|
arrange(selmon,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3986,10 +3986,11 @@ setmfact(const Arg *arg)
|
||||||
|
|
||||||
if (!arg || !selmon || !selmon->lt[selmon->sellt]->arrange)
|
if (!arg || !selmon || !selmon->lt[selmon->sellt]->arrange)
|
||||||
return;
|
return;
|
||||||
f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
|
f = arg->f < 1.0 ? arg->f + selmon->pertag->mfacts[selmon->pertag->curtag] : arg->f - 1.0;
|
||||||
if (f < 0.1 || f > 0.9)
|
if (f < 0.1 || f > 0.9)
|
||||||
return;
|
return;
|
||||||
selmon->mfact = f;
|
// selmon->mfact = f;
|
||||||
|
selmon->pertag->mfacts[selmon->pertag->curtag] = f;
|
||||||
arrange(selmon,false);
|
arrange(selmon,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4634,8 +4635,8 @@ tile(Monitor *m,unsigned int gappo, unsigned int uappi)
|
||||||
oe = 0; // outer gaps disabled
|
oe = 0; // outer gaps disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n > m->nmaster)
|
if (n > selmon->pertag->nmasters[selmon->pertag->curtag])
|
||||||
mw = m->nmaster ? (m->w.width + m->gappiv*ie) * m->mfact : 0;
|
mw = selmon->pertag->nmasters[selmon->pertag->curtag] ? (m->w.width + m->gappiv*ie) * selmon->pertag->mfacts[selmon->pertag->curtag] : 0;
|
||||||
else
|
else
|
||||||
mw = m->w.width - 2*m->gappov*oe + m->gappiv*ie;
|
mw = m->w.width - 2*m->gappov*oe + m->gappiv*ie;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
@ -4643,8 +4644,8 @@ tile(Monitor *m,unsigned int gappo, unsigned int uappi)
|
||||||
wl_list_for_each(c, &clients, link) {
|
wl_list_for_each(c, &clients, link) {
|
||||||
if (!VISIBLEON(c, m) || c->animation.tagouting || c->isfloating || c->isfullscreen || c->isfakefullscreen )
|
if (!VISIBLEON(c, m) || c->animation.tagouting || c->isfloating || c->isfullscreen || c->isfakefullscreen )
|
||||||
continue;
|
continue;
|
||||||
if (i < m->nmaster) {
|
if (i < selmon->pertag->nmasters[selmon->pertag->curtag]) {
|
||||||
r = MIN(n, m->nmaster) - i;
|
r = MIN(n, selmon->pertag->nmasters[selmon->pertag->curtag]) - i;
|
||||||
h = (m->w.height - my - m->gappoh*oe - m->gappih*ie * (r - 1)) / r;
|
h = (m->w.height - my - m->gappoh*oe - m->gappih*ie * (r - 1)) / r;
|
||||||
resize(c, (struct wlr_box){.x = m->w.x + m->gappov*oe, .y = m->w.y + my,
|
resize(c, (struct wlr_box){.x = m->w.x + m->gappov*oe, .y = m->w.y + my,
|
||||||
.width = mw - m->gappiv*ie, .height = h}, 0);
|
.width = mw - m->gappiv*ie, .height = h}, 0);
|
||||||
|
|
@ -4994,8 +4995,6 @@ view(const Arg *arg,bool want_animation)
|
||||||
selmon->pertag->curtag = tmptag;
|
selmon->pertag->curtag = tmptag;
|
||||||
}
|
}
|
||||||
|
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
||||||
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
||||||
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
||||||
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
||||||
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
||||||
|
|
@ -5035,8 +5034,6 @@ viewtoleft(const Arg *arg)
|
||||||
selmon->pertag->curtag = tmptag;
|
selmon->pertag->curtag = tmptag;
|
||||||
}
|
}
|
||||||
|
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
||||||
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
||||||
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
||||||
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
||||||
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
||||||
|
|
@ -5088,8 +5085,6 @@ viewtoright_have_client(const Arg *arg)
|
||||||
selmon->pertag->curtag = tmptag;
|
selmon->pertag->curtag = tmptag;
|
||||||
}
|
}
|
||||||
|
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
||||||
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
||||||
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
||||||
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
||||||
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
||||||
|
|
@ -5125,8 +5120,6 @@ viewtoright(const Arg *arg)
|
||||||
selmon->pertag->curtag = tmptag;
|
selmon->pertag->curtag = tmptag;
|
||||||
}
|
}
|
||||||
|
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
||||||
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
||||||
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
||||||
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
||||||
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
||||||
|
|
@ -5178,8 +5171,6 @@ viewtoleft_have_client(const Arg *arg)
|
||||||
selmon->pertag->curtag = tmptag;
|
selmon->pertag->curtag = tmptag;
|
||||||
}
|
}
|
||||||
|
|
||||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
||||||
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
||||||
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
||||||
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
||||||
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue