Re: [dev] [dwm] [patch] Need help regarding tilegap patch

From: deurzen <devrzen_AT_gmail.com>
Date: Sun, 7 Apr 2019 16:43:35 +0200

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.ajmain_AT_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
>
Received on Sun Apr 07 2019 - 16:43:35 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 07 2019 - 22:24:07 CEST