]> git.mdlowis.com Git - proto/anvil.git/commitdiff
fixed problem where windows were being resized to negative heights when restacking...
authorMichael D. Lowis <mike@mdlowis.com>
Mon, 30 Mar 2020 01:20:03 +0000 (21:20 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Mon, 30 Mar 2020 01:20:03 +0000 (21:20 -0400)
anvil.h
client.c
list.c
tile.c

diff --git a/anvil.h b/anvil.h
index 79a94811e17d738d59d20bcc405b43cc5c1a817a..f417f0eb8387623199e7e3c39c93c661136a237a 100644 (file)
--- 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);
index 7e23284a6be416d56ca6d44b5c9909c7884b83bb..b5fe0ca76f75597fbc8002ddaa546a3da07c9c92 100644 (file)
--- 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 d975505ab4fa131e1c8dce540aabaf599eb7adb2..646912ea78794aa34c5ce2764643b3cc8b5099ec 100644 (file)
--- 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 72b4bfcf9f90a9759aa4c50667aa2350235fded5..0ba15ad2f0a95d71b580a566839060d0ec0a7588 100644 (file)
--- 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;
     }