foo-wm

(Archived) Experimental Zooming IPC-based WM
git clone http://milesalan.com/git/foo-wm
Log | Files | Refs | Mirror | README | LICENSE

commit 02637c2465304b93f612fad74b9587752290e0d7
parent 7c377994da804b672e3a88748211631d5cd02b73
Author: Miles Sandlar <miles.sandlar@gmail.com>
Date:   Sat,  7 Jul 2012 15:40:44 -0400

Update previous pointer in brotherNode when add

Diffstat:
Msrc/commands.c | 2++
Msrc/tree.c | 6++++--
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/commands.c b/src/commands.c @@ -80,6 +80,8 @@ void containerize() { insertNode = focusedNode -> previous; insertPosition = 1; } else if (focusedNode -> next != NULL) { insertNode = focusedNode -> next; insertPosition = 0; + } else { + fprintf(stderr, "NO INSERT NODE\n"); } parentNode(focusedNode, newContainer); diff --git a/src/tree.c b/src/tree.c @@ -14,6 +14,7 @@ void crawlNode(Node * node, int level) { fprintf(stderr, "Client (%p)", node); if (node == focusedNode) fprintf(stderr, " [Focused]"); if (node == viewNode) fprintf(stderr, " [View]"); + //fprintf(stderr, " || N[%p] P[%p]", node -> next, node -> previous); fprintf(stderr, "\n"); } else { @@ -26,15 +27,15 @@ void crawlNode(Node * node, int level) { fprintf(stderr, "Container (%p) %s", node, label); if (node == selectedNode) fprintf(stderr, " [Selected]"); if (node == viewNode) fprintf(stderr, " [View]"); + //fprintf(stderr, " || N[%p] P[%p]", node -> next, node -> previous); fprintf(stderr, "\n"); - - Node *n; for (n = node -> child; n != NULL; n = n -> next) { crawlNode(n, level + 1); } } + } void dumpTree() { @@ -151,6 +152,7 @@ void brotherNode(Node *node, Node * brother, int position) { } else if (position == 1) { node -> previous = brother; node -> next = brother -> next; + if (node -> next != NULL) node -> next -> previous = node; brother -> next = node; } }