From 39df1ca4ada8374da4b0c3f29ee8d284f1a95752 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Mon, 5 Apr 2021 08:14:27 +0200 Subject: [PATCH] Initialise gaps for pertag arrays when monitor is created ref. #106 --- dwm.c | 6 ++++-- patch/floatpos.c | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dwm.c b/dwm.c index 5c1898f..31061f6 100644 --- a/dwm.c +++ b/dwm.c @@ -1608,9 +1608,11 @@ createmon(void) #endif // MONITOR_RULES_PATCH m->pertag->sellts[i] = m->sellt; - #if VANITYGAPS_PATCH + #if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH m->pertag->enablegaps[i] = 1; - #endif // VANITYGAPS_PATCH + m->pertag->gaps[i] = + ((gappoh & 0xFF) << 0) | ((gappov & 0xFF) << 8) | ((gappih & 0xFF) << 16) | ((gappiv & 0xFF) << 24); + #endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH } #endif // PERTAG_PATCH #if INSETS_PATCH diff --git a/patch/floatpos.c b/patch/floatpos.c index d481fbc..f0568f1 100644 --- a/patch/floatpos.c +++ b/patch/floatpos.c @@ -20,10 +20,10 @@ setfloatpos(Client *c, const char *floatpos) { char xCh, yCh, wCh, hCh; int x, y, w, h, wx, ww, wy, wh; - #if FLOATPOS_RESPECT_GAPS_PATCH + #if FLOATPOS_RESPECT_GAPS_PATCH && VANITYGAPS_PATCH int oh, ov, ih, iv; unsigned int n; - #endif // FLOATPOS_RESPECT_GAPS_PATCH + #endif // FLOATPOS_RESPECT_GAPS_PATCH | VANITYGAPS_PATCH if (!c || !floatpos) return; @@ -57,7 +57,7 @@ setfloatpos(Client *c, const char *floatpos) return; } - #if FLOATPOS_RESPECT_GAPS_PATCH + #if FLOATPOS_RESPECT_GAPS_PATCH && VANITYGAPS_PATCH getgaps(c->mon, &oh, &ov, &ih, &iv, &n); wx = c->mon->wx + ov; wy = c->mon->wy + oh; @@ -68,7 +68,7 @@ setfloatpos(Client *c, const char *floatpos) wy = c->mon->wy; ww = c->mon->ww; wh = c->mon->wh; - #endif // FLOATPOS_RESPECT_GAPS_PATCH + #endif // FLOATPOS_RESPECT_GAPS_PATCH | VANITYGAPS_PATCH getfloatpos(x, xCh, w, wCh, wx, ww, c->x, c->w, c->bw, floatposgrid_x, &c->x, &c->w); getfloatpos(y, yCh, h, hCh, wy, wh, c->y, c->h, c->bw, floatposgrid_y, &c->y, &c->h);