Pertag togglegaps change ref. issue #11

pull/32/head
bakkeby 4 years ago
parent 4b45c6071f
commit e75decf7de

@ -1255,6 +1255,10 @@ createmon(void)
m->pertag->prevzooms[i] = NULL;
#endif // ZOOMSWAP_PATCH
#endif // PERTAGBAR_PATCH
#if VANITYGAPS_PATCH
m->pertag->enablegaps[i] = 1;
#endif // VANITYGAPS_PATCH
}
#endif // PERTAG_PATCH
return m;

@ -13,12 +13,15 @@ struct Pertag {
#if PERTAGBAR_PATCH
Bool showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
#endif // PERTAGBAR_PATCH
#if ZOOMSWAP_PATCH
Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
#endif // ZOOMSWAP_PATCH
#if SWAPFOCUS_PATCH
Client *prevclient[LENGTH(tags) + 1];
#endif // SWAPFOCUS_PATCH
#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
};
void

@ -1,5 +1,7 @@
/* Settings */
#if !PERTAG_PATCH
static int enablegaps = 1;
#endif // PERTAG_PATCH
static void
setgaps(int oh, int ov, int ih, int iv)
@ -19,7 +21,11 @@ setgaps(int oh, int ov, int ih, int iv)
static void
togglegaps(const Arg *arg)
{
#if PERTAG_PATCH
selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag];
#else
enablegaps = !enablegaps;
#endif // PERTAG_PATCH
arrange(NULL);
}
@ -110,7 +116,12 @@ incrivgaps(const Arg *arg)
static void
getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc)
{
unsigned int n, oe = enablegaps, ie = enablegaps;
unsigned int n, oe, ie;
#if PERTAG_PATCH
oe = ie = selmon->pertag->enablegaps[selmon->pertag->curtag];
#else
oe = ie = enablegaps;
#endif // PERTAG_PATCH
Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
@ -124,4 +135,4 @@ getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc)
*iv = m->gappiv*ie; // inner vertical gap
*nc = n; // number of clients
}
#endif
#endif

Loading…
Cancel
Save