diff --git a/config.h b/config.h index 9106633..53835c7 100644 --- a/config.h +++ b/config.h @@ -123,7 +123,7 @@ static Key keys[] = { { MODKEY, XK_l, setmfact, {.f = +0.05} }, { MODKEY, XK_Return, zoom, {0} }, - // Vanity Gaps Modifiers + // Vanity Gaps Modifiers // { MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } }, // { MODKEY|Mod4Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } }, // { MODKEY|Mod4Mask, XK_i, incrigaps, {.i = +1 } }, diff --git a/dwm.c b/dwm.c index 3ec5c11..43d1a36 100644 --- a/dwm.c +++ b/dwm.c @@ -1345,11 +1345,11 @@ resizeclient(Client *c, int x, int y, int w, int h) c->oldh = c->h; c->h = wc.height = h; wc.border_width = c->bw; - for (n = 0, nbc = nexttiled(selmon->clients); nbc; nbc = nexttiled(nbc->next), n++); + for (n = 0, nbc = nexttiled(c->mon->clients); nbc; nbc = nexttiled(nbc->next), n++); - if (c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) { + if (c->isfloating || c->mon->lt[c->mon->sellt]->arrange == NULL) { } else { - if (selmon->lt[selmon->sellt]->arrange == monocle || n == 1) { + if (c->mon->lt[c->mon->sellt]->arrange == monocle || n == 1) { wc.border_width = 0; c->w = wc.width += c->bw * 2; c->h = wc.height += c->bw * 2; diff --git a/patches/debug-print.snip.c b/patches/debug-print.snip.c new file mode 100644 index 0000000..ec1f04b --- /dev/null +++ b/patches/debug-print.snip.c @@ -0,0 +1,23 @@ +#include +#include + +void debug_print(char *str) +{ + time_t t = time(NULL); + char *t_str = ctime(&t); + FILE *fp; + fp = fopen("/home/michael/dwm-debug.txt", "a"); + fprintf(fp, "%s: %s", t_str, str); + fclose(fp); +} + +void resize() { + char s[2048]; + sprintf(s, "resize client. name: %s, mon: %p, selmon: %p\n\tx: %d, y: %d, w: %d, h: %d\n\tn: %d, flt: %d, arrange: %p\n\tismonocle: %d\n", + c->name, c->mon, selmon, + x, y, w, h, + n, c->isfloating, c->mon->lt[c->mon->sellt]->arrange, + c->mon->lt[c->mon->sellt]->arrange == monocle + ); + debug_print(s); +}