foo-wm

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

commit 5f5f66d163bc715b2a60cb9a8ccdc068eb7e35d4
parent 1f58aaebe8a4d78cacf87cb708a5d74c593a2cb4
Author: = <miles.sandlar@gmail.com>
Date:   Fri, 27 Jul 2012 21:11:40 -0400

Functioning focus parent

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

diff --git a/src/commands.c b/src/commands.c @@ -106,12 +106,11 @@ void focus(char * brotherOrPc, int delta) { Node * newFocus; if (brotherSwitch) { newFocus = getBrother(focusedNode, (delta < 0) ? -1 : 1); - if (viewNode == newFocus) - placeNode(viewNode, rootX, rootY, rootWidth, rootHeight); } else { newFocus = delta < 0 ? focusedNode -> parent : focusedNode -> child; } + if (focusedNode == newFocus) return; focusNode(newFocus, NULL, True); delta = delta + ( delta > 0 ? -1 : 1); } diff --git a/src/tree.c b/src/tree.c @@ -80,9 +80,11 @@ Bool unfocusNode(Node * n) { //This should focus OR select void focusNode(Node * n, XEvent * event, Bool setFocused) { if (!n || n == focusedNode) return; + fprintf(stderr, "Focusing %p", n); + + if (setFocused) focusedNode = n; if (n -> parent) n -> parent -> focus = n; - Bool setView = unfocusNode(focusedNode); if (isClient(n)) { if (n -> parent) { @@ -107,10 +109,9 @@ void focusNode(Node * n, XEvent * event, Bool setFocused) { centerPointer(&n -> window); } } else { - fprintf(stderr, "focus claled ona ctaonerin"); Node *i; - for (i = n -> parent -> child; i; i = i -> next) { + for (i = n -> child; i; i = i -> next) { if (i == n) { //The Focused node requested thats a container focusNode(n, NULL, False); } else if (isClient(i)) { //Must dehigh these clients, unfocused_inactive