2019-09-05 20:58:16 +00:00
|
|
|
struct Pertag {
|
2023-01-18 20:18:14 +00:00
|
|
|
unsigned int curtag; /* current tag index */
|
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
|
2021-04-04 08:49:25 +00:00
|
|
|
#if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH
|
2021-05-19 15:41:25 +00:00
|
|
|
int enablegaps[NUMTAGS + 1];
|
2021-04-04 08:49:25 +00:00
|
|
|
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;
|
2023-01-18 20:18:14 +00:00
|
|
|
|
|
|
|
#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
|
|
|
|
if (arg->ui == ~SPTAGMASK)
|
|
|
|
#else
|
|
|
|
if (arg->ui == ~0)
|
|
|
|
#endif // SCRATCHPADS_PATCH
|
|
|
|
selmon->pertag->curtag = 0;
|
|
|
|
else {
|
|
|
|
for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++);
|
|
|
|
selmon->pertag->curtag = i + 1;
|
2019-09-30 21:52:51 +00:00
|
|
|
}
|
2023-01-18 20:18:14 +00:00
|
|
|
|
2019-09-30 21:52:51 +00:00
|
|
|
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
|
2021-06-14 05:16:17 +00:00
|
|
|
}
|
|
|
|
|