Nothing wrong with that. Only situation in which this would crash is if 2*gappx exceeds the width or height of the tiled area, obviously.
> On 7 Apr 2019, at 16:15, Enan Ajmain <3nan.ajm...@gmail.com> wrote: > > Hi, > I am using dwm-tilegap-6.2 patch to get gaps around windows. But the > gaps only show in tiling mode. I assumed that similar support for > monocle mode could be easily hacked. Now, I changed the monocle > function in `dwm.c` in the following way. > > ``` > void > monocle(Monitor *m) > { > unsigned int n = 0; > Client *c; > > for (c = m->clients; c; c = c->next) > if (ISVISIBLE(c)) > n++; > if (n > 0) /* override layout symbol */ > snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); > for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) > resize(c, m->wx + gappx, m->wy + gappx, m->ww - 2 * c->bw - 2 * gappx, > m->wh - 2 * c->bw - 2 * gappx, 0); > } > ``` > > You will see that the only change I have made is adding `gappx` amount > of space to both `m->wx` and `m->wy` and subtracting `2 * gappx` > amount of space from both `m->ww` and `m->wh`. It's very simple stuff. > But due to my lack of experience, I wanted to make sure whether this > will be in any way harmful. I don't want my window manager to crash > when I need it. So, if someone could point out the faults if any, it > would be much appreciated. > > Thanks, > Enan Ajmain >