2019-09-05 20:58:16 +00:00
|
|
|
struct Pertag {
|
|
|
|
unsigned int curtag, prevtag; /* current and previous tag */
|
|
|
|
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
|
2019-09-30 21:52:51 +00:00
|
|
|
#if FLEXTILE_DELUXE_LAYOUT
|
|
|
|
int nstacks[LENGTH(tags) + 1]; /* number of windows in primary stack area */
|
|
|
|
int ltaxis[LENGTH(tags) + 1][LTAXIS_LAST];
|
|
|
|
const Layout *ltidxs[LENGTH(tags) + 1][3]; /* matrix of tags and layouts indexes */
|
|
|
|
#else
|
|
|
|
const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
|
|
|
|
#endif // FLEXTILE_DELUXE_LAYOUT
|
2019-09-05 20:58:16 +00:00
|
|
|
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
|
|
|
|
unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
|
|
|
|
#if PERTAGBAR_PATCH
|
2020-04-26 14:46:10 +00:00
|
|
|
int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
|
2019-09-05 20:58:16 +00:00
|
|
|
#endif // PERTAGBAR_PATCH
|
2020-01-29 07:31:00 +00:00
|
|
|
#if SWAPFOCUS_PATCH
|
|
|
|
Client *prevclient[LENGTH(tags) + 1];
|
|
|
|
#endif // SWAPFOCUS_PATCH
|
2020-03-07 11:44:42 +00:00
|
|
|
#if ZOOMSWAP_PATCH
|
|
|
|
Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
|
|
|
|
#endif // ZOOMSWAP_PATCH
|
|
|
|
#if VANITYGAPS_PATCH
|
|
|
|
int enablegaps[LENGTH(tags) + 1];
|
|
|
|
#endif // VANITYGAPS_PATCH
|
2019-09-30 21:52:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void
|
|
|
|
pertagview(const Arg *arg)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
unsigned int tmptag;
|
|
|
|
|
|
|
|
if (arg->ui & TAGMASK) {
|
|
|
|
selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
|
|
|
if (arg->ui == ~0)
|
|
|
|
selmon->pertag->curtag = 0;
|
|
|
|
else {
|
2020-05-01 14:45:25 +00:00
|
|
|
for (i = 0; !(arg->ui & 1 << i); i++) ;
|
2019-09-30 21:52:51 +00:00
|
|
|
selmon->pertag->curtag = i + 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
tmptag = selmon->pertag->prevtag;
|
|
|
|
selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
selmon->pertag->curtag = tmptag;
|
|
|
|
}
|
|
|
|
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
|
|
#if FLEXTILE_DELUXE_LAYOUT
|
|
|
|
selmon->nstack = selmon->pertag->nstacks[selmon->pertag->curtag];
|
|
|
|
#endif // FLEXTILE_DELUXE_LAYOUT
|
|
|
|
selmon->mfact = selmon->pertag->mfacts[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^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
2020-05-01 12:14:38 +00:00
|
|
|
#if FLEXTILE_DELUXE_LAYOUT
|
2019-09-30 21:52:51 +00:00
|
|
|
selmon->ltaxis[LAYOUT] = selmon->pertag->ltaxis[selmon->pertag->curtag][LAYOUT];
|
|
|
|
selmon->ltaxis[MASTER] = selmon->pertag->ltaxis[selmon->pertag->curtag][MASTER];
|
|
|
|
selmon->ltaxis[STACK] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK];
|
|
|
|
selmon->ltaxis[STACK2] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK2];
|
2020-05-01 12:14:38 +00:00
|
|
|
#endif // FLEXTILE_DELUXE_LAYOUT
|
2019-09-30 21:52:51 +00:00
|
|
|
#if PERTAGBAR_PATCH
|
|
|
|
if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
|
|
|
togglebar(NULL);
|
|
|
|
#endif // PERTAGBAR_PATCH
|
|
|
|
}
|