foo-wm

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

commit c9f8c319b0b0bb802c7d166d4b1d6cb6e953d6ae
parent fed8eae574c60ee855351d4f47b50792a8016f59
Author: = <miles.sandlar@gmail.com>
Date:   Sun, 19 Aug 2012 20:19:26 -0400

Only re-place the old focus if its within the view

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

diff --git a/config/commands b/config/commands @@ -1,4 +1,6 @@ dump +jump +mark layout grid layout horizontal layout vertical diff --git a/src/tree.c b/src/tree.c @@ -97,7 +97,7 @@ void focusNode(Node * n, XEvent * event, Bool setFocused, Bool focusPath) { if (setFocused) { focusedNode = n; - if (oldFocus) { + if (oldFocus && nodeIsParentOf(viewNode, oldFocus)) { placeNode(oldFocus , oldFocus -> x, oldFocus -> y, oldFocus -> width, oldFocus -> height); } @@ -234,7 +234,7 @@ void unmapNode(Node * node) { if (isClient(node)) { XUnmapWindow(display, node -> window); } else { - Node *n; + Node *n = NULL; for (n = node -> child; n; n = n -> next) unmapNode(n); } @@ -404,7 +404,6 @@ Node * getClientByDirection(Node * originNode, int direction) { /* Searches nodeA for an occurance of nodeB * if successful, return true */ Bool nodeIsParentOf(Node * nodeA, Node * nodeB) { - if (nodeA == nodeB) return True; Node *n = NULL; for (n = nodeA -> child; n; n = n -> next) {