dwm

Kris's build of dwm
git clone git clone https://git.krisyotam.com/krisyotam/dwm.git
Log | Files | Refs | README | LICENSE

pertag.c (2845B)


      1 struct Pertag {
      2 	unsigned int curtag; /* current tag index */
      3 	int nmasters[NUMTAGS + 1]; /* number of windows in master area */
      4 	#if FLEXTILE_DELUXE_LAYOUT
      5 	int nstacks[NUMTAGS + 1]; /* number of windows in primary stack area */
      6 	int ltaxis[NUMTAGS + 1][LTAXIS_LAST];
      7 	const Layout *ltidxs[NUMTAGS + 1][3]; /* matrix of tags and layouts indexes  */
      8 	#else
      9 	const Layout *ltidxs[NUMTAGS + 1][2]; /* matrix of tags and layouts indexes  */
     10 	#endif // FLEXTILE_DELUXE_LAYOUT
     11 	float mfacts[NUMTAGS + 1]; /* mfacts per tag */
     12 	unsigned int sellts[NUMTAGS + 1]; /* selected layouts */
     13 	#if PERTAGBAR_PATCH
     14 	int showbars[NUMTAGS + 1]; /* display bar for the current tag */
     15 	#endif // PERTAGBAR_PATCH
     16 	#if SWAPFOCUS_PATCH
     17 	Client *prevclient[NUMTAGS + 1];
     18 	#endif // SWAPFOCUS_PATCH
     19 	#if ZOOMSWAP_PATCH
     20 	Client *prevzooms[NUMTAGS + 1]; /* store zoom information */
     21 	#endif // ZOOMSWAP_PATCH
     22 	#if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH
     23 	int enablegaps[NUMTAGS + 1];
     24 	int gaps[NUMTAGS + 1];
     25 	#endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH
     26 };
     27 
     28 void
     29 pertagview(const Arg *arg)
     30 {
     31 	int i;
     32 
     33 	#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
     34 	if (arg->ui == ~SPTAGMASK)
     35 	#else
     36 	if (arg->ui == ~0)
     37 	#endif // SCRATCHPADS_PATCH
     38 		selmon->pertag->curtag = 0;
     39 	else {
     40 		for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++);
     41 		selmon->pertag->curtag = i + 1;
     42 	}
     43 
     44 	selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
     45 	#if FLEXTILE_DELUXE_LAYOUT
     46 	selmon->nstack = selmon->pertag->nstacks[selmon->pertag->curtag];
     47 	#endif // FLEXTILE_DELUXE_LAYOUT
     48 	selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
     49 	selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
     50 	selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
     51 	selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
     52 
     53 	#if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH
     54 	selmon->gappoh = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff) >> 0;
     55 	selmon->gappov = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff00) >> 8;
     56 	selmon->gappih = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff0000) >> 16;
     57 	selmon->gappiv = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff000000) >> 24;
     58 	#endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH
     59 
     60 	#if FLEXTILE_DELUXE_LAYOUT
     61 	selmon->ltaxis[LAYOUT] = selmon->pertag->ltaxis[selmon->pertag->curtag][LAYOUT];
     62 	selmon->ltaxis[MASTER] = selmon->pertag->ltaxis[selmon->pertag->curtag][MASTER];
     63 	selmon->ltaxis[STACK]  = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK];
     64 	selmon->ltaxis[STACK2] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK2];
     65 	#endif // FLEXTILE_DELUXE_LAYOUT
     66 	#if PERTAGBAR_PATCH
     67 	if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
     68 		togglebar(NULL);
     69 	#endif // PERTAGBAR_PATCH
     70 }
     71