Initialise gaps for pertag arrays when monitor is created ref. #106

This commit is contained in:
bakkeby 2021-04-05 08:14:27 +02:00
parent 521f87af13
commit 39df1ca4ad
2 changed files with 8 additions and 6 deletions

6
dwm.c
View File

@ -1608,9 +1608,11 @@ createmon(void)
#endif // MONITOR_RULES_PATCH #endif // MONITOR_RULES_PATCH
m->pertag->sellts[i] = m->sellt; m->pertag->sellts[i] = m->sellt;
#if VANITYGAPS_PATCH #if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH
m->pertag->enablegaps[i] = 1; 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 #endif // PERTAG_PATCH
#if INSETS_PATCH #if INSETS_PATCH

View File

@ -20,10 +20,10 @@ setfloatpos(Client *c, const char *floatpos)
{ {
char xCh, yCh, wCh, hCh; char xCh, yCh, wCh, hCh;
int x, y, w, h, wx, ww, wy, wh; 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; int oh, ov, ih, iv;
unsigned int n; unsigned int n;
#endif // FLOATPOS_RESPECT_GAPS_PATCH #endif // FLOATPOS_RESPECT_GAPS_PATCH | VANITYGAPS_PATCH
if (!c || !floatpos) if (!c || !floatpos)
return; return;
@ -57,7 +57,7 @@ setfloatpos(Client *c, const char *floatpos)
return; return;
} }
#if FLOATPOS_RESPECT_GAPS_PATCH #if FLOATPOS_RESPECT_GAPS_PATCH && VANITYGAPS_PATCH
getgaps(c->mon, &oh, &ov, &ih, &iv, &n); getgaps(c->mon, &oh, &ov, &ih, &iv, &n);
wx = c->mon->wx + ov; wx = c->mon->wx + ov;
wy = c->mon->wy + oh; wy = c->mon->wy + oh;
@ -68,7 +68,7 @@ setfloatpos(Client *c, const char *floatpos)
wy = c->mon->wy; wy = c->mon->wy;
ww = c->mon->ww; ww = c->mon->ww;
wh = c->mon->wh; 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(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); getfloatpos(y, yCh, h, hCh, wy, wh, c->y, c->h, c->bw, floatposgrid_y, &c->y, &c->h);