foo-wm

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

commit 06648669aae3e2311ac749a0bdd86c2d2c682a3b
parent e954d059e45609dd77ecde963e0f0b81f3697dad
Author: = <miles.sandlar@gmail.com>
Date:   Sat, 28 Jul 2012 17:01:35 -0400

Focusing in the focuspath for placeNode

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

diff --git a/src/config.h b/src/config.h @@ -7,12 +7,10 @@ #define SCREEN_PADDING_BOTTOM (8) #define SCREEN_PADDING_RIGHT (8) - // Containers #define CONTAINER_DEFAULT_LAYOUT (GRID) #define CONTAINER_PADDING (8) - // Windows #define CLIENT_FOCUSED_COLOR "rgb:AB/DB/F5" #define CLIENT_UNFOCUSED_COLOR "rgb:54/54/54" diff --git a/src/tree.c b/src/tree.c @@ -244,8 +244,13 @@ void placeNode(Node * node, int x, int y, int width, int height) { (height - (border * 2)) > 0 ? (height- border * 2) : 1); XSetWindowBorderWidth(display, node -> window, border); + Node *b = node; Bool inFocusPath = False; + do { //Figure out if were in the focus path + if (b == focusedNode) inFocusPath = True; break; + } while ((b = b -> parent)); + XSetWindowBorder(display, node -> window, - (focusedNode == node ? focusedColor : unfocusedColor)); + (inFocusPath ? focusedColor : unfocusedColor)); } else { //Count up children prior to loop