From: Michael D. Lowis Date: Mon, 30 Mar 2020 01:20:03 +0000 (-0400) Subject: fixed problem where windows were being resized to negative heights when restacking... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=3815f80bbc7b9b742ab6559341f41c6a2e906c25;p=proto%2Fanvil.git fixed problem where windows were being resized to negative heights when restacking from monocle mode --- diff --git a/anvil.h b/anvil.h index 79a9481..f417f0e 100644 --- a/anvil.h +++ b/anvil.h @@ -114,7 +114,6 @@ typedef struct { extern XConf X; /* list.c */ -//void* list_add(void* list, void* node); int list_length(void* list); void* list_del(void* list, void* node); void* list_prev(void* list, void* curr); diff --git a/client.c b/client.c index 7e23284..b5fe0ca 100644 --- a/client.c +++ b/client.c @@ -98,6 +98,7 @@ void client_move(Client* c, int xdiff, int ydiff) { c->x += xdiff; c->y += ydiff; + printf("MOVE(c: %lx x: %d y: %d)\n", c->frame, c->x, c->y); XMoveWindow(X.disp, c->frame, c->x, c->y); mons_place(c); } @@ -115,6 +116,11 @@ void client_resize(Client* c, int xdiff, int ydiff) else { XResizeWindow(X.disp, c->frame, c->w, c->h); + printf("RESIZE(c: %lx w: %d h: %d)\n", + c->win, + c->w - 2*BORDER_WIDTH - 2, + c->h - 2*BORDER_WIDTH - TITLE_HEIGHT - 2 + ); XResizeWindow(X.disp, c->win, c->w - 2*BORDER_WIDTH - 2, c->h - 2*BORDER_WIDTH - TITLE_HEIGHT - 2 diff --git a/list.c b/list.c index d975505..646912e 100644 --- a/list.c +++ b/list.c @@ -28,7 +28,7 @@ void* list_del(void* list, void* node) void* list_prev(void* list, void* node) { Node *prev = list, *n = node; - for (; prev->next != n; prev = prev->next); + for (; prev && prev->next != n; prev = prev->next); return prev; } diff --git a/tile.c b/tile.c index 72b4bfc..0ba15ad 100644 --- a/tile.c +++ b/tile.c @@ -125,7 +125,7 @@ void stacked_set(Monitor* mon, Column* col, Client* c) { c->y = starty; c->h = MIN_HEIGHT; - client_setshade(c, 0); + client_setshade(c, 1); client_adjust(c); starty += MIN_HEIGHT; }