summaryrefslogtreecommitdiffhomepage
path: root/patch/pertag.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-08-25 16:27:14 +0200
committerbakkeby <[email protected]>2020-08-25 16:27:14 +0200
commitf45acf87959d42808a198042efe2cc6185ce7fd1 (patch)
tree99c1b14baba796ae04b259d1f3d8bac5740af8f4 /patch/pertag.c
parentdf57bdeb64a1673276ab6fb2ed00fd6c9ad3c2b1 (diff)
downloaddwm-flexipatch-f45acf87959d42808a198042efe2cc6185ce7fd1.tar.gz
dwm-flexipatch-f45acf87959d42808a198042efe2cc6185ce7fd1.zip
Added alttagsdecoration patch.
Unified tag icon handling while adding support for different icons per monitor. In general LENGTH(tags) has been replaced with a NUMTAGS macro (defaulting to 9) and the tags[] array has been replaced with a tagicons[][] array, access to which is done through a single function tagicon. This allows one central place where alternative tags, alttagsdecoration, or other future tags logic is handled. This also gives a consistent display of tags regardless of the module that presents tags. Additionally the monitor index has been integrated into dwm for easier access.
Diffstat (limited to 'patch/pertag.c')
-rw-r--r--patch/pertag.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/patch/pertag.c b/patch/pertag.c
index cc97a6c..2889e0e 100644
--- a/patch/pertag.c
+++ b/patch/pertag.c
@@ -1,26 +1,26 @@
struct Pertag {
unsigned int curtag, prevtag; /* current and previous tag */
- int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
+ int nmasters[NUMTAGS + 1]; /* number of windows in master area */
#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 */
+ 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 */
#else
- const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
+ const Layout *ltidxs[NUMTAGS + 1][2]; /* matrix of tags and layouts indexes */
#endif // FLEXTILE_DELUXE_LAYOUT
- float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
- unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
+ float mfacts[NUMTAGS + 1]; /* mfacts per tag */
+ unsigned int sellts[NUMTAGS + 1]; /* selected layouts */
#if PERTAGBAR_PATCH
- int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
+ int showbars[NUMTAGS + 1]; /* display bar for the current tag */
#endif // PERTAGBAR_PATCH
#if SWAPFOCUS_PATCH
- Client *prevclient[LENGTH(tags) + 1];
+ Client *prevclient[NUMTAGS + 1];
#endif // SWAPFOCUS_PATCH
#if ZOOMSWAP_PATCH
- Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
+ Client *prevzooms[NUMTAGS + 1]; /* store zoom information */
#endif // ZOOMSWAP_PATCH
#if VANITYGAPS_PATCH
- int enablegaps[LENGTH(tags) + 1];
+ int enablegaps[NUMTAGS + 1];
#endif // VANITYGAPS_PATCH
};
@@ -29,7 +29,6 @@ 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;
@@ -52,6 +51,7 @@ pertagview(const Arg *arg)
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];
+
#if FLEXTILE_DELUXE_LAYOUT
selmon->ltaxis[LAYOUT] = selmon->pertag->ltaxis[selmon->pertag->curtag][LAYOUT];
selmon->ltaxis[MASTER] = selmon->pertag->ltaxis[selmon->pertag->curtag][MASTER];