Make code made by pertag patch more readable

This commit is contained in:
Alex Kotov 2021-11-13 02:29:39 +05:00
parent 254b6a4c13
commit bd4ebce470
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 18 additions and 6 deletions

24
dwm.c
View File

@ -1788,15 +1788,27 @@ setfullscreen(Client *c, int fullscreen)
void
setlayout(const Arg *arg)
{
if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) {
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
if (arg && arg->v)
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
if (selmon->sel)
}
if (arg && arg->v) {
const Layout *const new_layout = arg->v;
selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = new_layout;
selmon->lt[selmon->sellt] = new_layout;
}
strncpy(
selmon->ltsymbol,
selmon->lt[selmon->sellt]->symbol,
sizeof(selmon->ltsymbol)
);
if (selmon->sel) {
arrange(selmon);
else
} else {
drawbar(selmon);
}
}
/* arg > 1.0 will set mfact absolutely */