2019-09-05 20:58:16 +00:00
|
|
|
struct Pertag {
|
|
|
|
unsigned int curtag, prevtag; /* current and previous tag */
|
2020-08-25 14:27:14 +00:00
|
|
|
int nmasters[NUMTAGS + 1]; /* number of windows in master area */
|
2019-09-30 21:52:51 +00:00
|
|
|
#if FLEXTILE_DELUXE_LAYOUT
|
2020-08-25 14:27:14 +00:00
|
|
|
int nstacks[NUMTAGS + 1]; /* number of windows in primary stack area */
|
|
|
|
int ltaxis[NUMTAGS + 1][LTAXIS_LAST];
|
|
|
|
const Layout *ltidxs[NUMTAGS + 1][3]; /* matrix of tags and layouts indexes */
|
2019-09-30 21:52:51 +00:00
|
|
|
#else
|
2020-08-25 14:27:14 +00:00
|
|
|
const Layout *ltidxs[NUMTAGS + 1][2]; /* matrix of tags and layouts indexes */
|
2019-09-30 21:52:51 +00:00
|
|
|
#endif // FLEXTILE_DELUXE_LAYOUT
|
2020-08-25 14:27:14 +00:00
|
|
|
float mfacts[NUMTAGS + 1]; /* mfacts per tag */
|
|
|
|
unsigned int sellts[NUMTAGS + 1]; /* selected layouts */
|
2019-09-05 20:58:16 +00:00
|
|
|
#if PERTAGBAR_PATCH
|
2020-08-25 14:27:14 +00:00
|
|
|
int showbars[NUMTAGS + 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
|
2020-08-25 14:27:14 +00:00
|
|
|
Client *prevclient[NUMTAGS + 1];
|
2020-01-29 07:31:00 +00:00
|
|
|
#endif // SWAPFOCUS_PATCH
|
2020-03-07 11:44:42 +00:00
|
|
|
#if ZOOMSWAP_PATCH
|
2020-08-25 14:27:14 +00:00
|
|
|
Client *prevzooms[NUMTAGS + 1]; /* store zoom information */
|
2020-03-07 11:44:42 +00:00
|
|
|
#endif // ZOOMSWAP_PATCH
|
|
|
|
#if VANITYGAPS_PATCH
|
2020-08-25 14:27:14 +00:00
|
|
|
int enablegaps[NUMTAGS + 1];
|
2020-03-07 11:44:42 +00:00
|
|
|
#endif // VANITYGAPS_PATCH
|
2021-04-04 08:49:25 +00:00
|
|
|
#if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH
|
|
|
|
unsigned int gaps[NUMTAGS + 1];
|
|
|
|
#endif // PERTAG_VANITYGAPS_PATCH | 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;
|
2020-09-28 15:48:49 +00:00
|
|
|
#if SCRATCHPADS_PATCH
|
|
|
|
if (arg->ui == ~SPTAGMASK)
|
|
|
|
#else
|
2019-09-30 21:52:51 +00:00
|
|
|
if (arg->ui == ~0)
|
2020-09-28 15:48:49 +00:00
|
|
|
#endif // SCRATCHPADS_PATCH
|
2019-09-30 21:52:51 +00:00
|
|
|
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-08-25 14:27:14 +00:00
|
|
|
|
2021-04-04 08:49:25 +00:00
|
|
|
#if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH
|
|
|
|
selmon->gappoh = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff) >> 0;
|
|
|
|
selmon->gappov = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff00) >> 8;
|
|
|
|
selmon->gappih = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff0000) >> 16;
|
|
|
|
selmon->gappiv = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff000000) >> 24;
|
|
|
|
#endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH
|
|
|
|
|
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
|
|
|
|
}
|