foo-wm

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

commit 562f4da79cfdcb0854932c1fe38e94e74783422a
parent 29499aec5b2be7930091bc054e70e25ce8b3c083
Author: = <miles.sandlar@gmail.com>
Date:   Tue, 31 Jul 2012 18:38:56 -0400

Fixes to foo

Diffstat:
MMakefile | 2+-
Mconfig/.xbindkeysrc | 2+-
Msrc/commands.c | 4+++-
Msrc/tree.c | 28+++++++++++++++++++---------
4 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ CLI_OBJS= client.o all: foo-wm foo-wm-c -foo-wm: $(WM_OBJS) +foo-wm: $(WM_OBJS) $(CC) $(CFLAGS) $(WM_OBJS) -o foo-wm foo-wm-c: $(CLI_OBJS) diff --git a/config/.xbindkeysrc b/config/.xbindkeysrc @@ -52,7 +52,7 @@ m:0x40 + c:32 Mod4 + o -"foo-wm-c /tmp/foo-wm.socket 'focus pc -1'" +"foo-wm-c /tmp/foo-wm.socket 'focus pc 1'" m:0x40 + c:33 Mod4 + p diff --git a/src/commands.c b/src/commands.c @@ -19,7 +19,7 @@ char * nextToken(char ** tokenString) { } char * handleCommand(char * request) { - fprintf(stderr, "Recv from FIFO: %s", request); + fprintf(stderr, "Recv from Socket: %s", request); char *tokens[5]; char *token; int i = 0; while ((token = nextToken(&request))) { @@ -92,6 +92,8 @@ void zoom(int level) { unmapNode(viewNode); viewNode = n; //TODO:: Need placeNode to be aware of focusnnode (in)active colors.... + + fprintf(stderr, "placeing yo"); placeNode(viewNode, rootX, rootY, rootWidth, rootHeight); level--; } diff --git a/src/tree.c b/src/tree.c @@ -60,15 +60,15 @@ Bool unfocusNode(Node * n, Bool focusPath) { //Unfocusing Code for previous focusedNode if (isClient(n)) { /*XSetWindowBorder(display, n -> window, - (n -> parent -> focus == n) ? - inactiveFocusedColor : inactiveUnfocusedColor); - */ + (n -> parent -> focus == n) ? +inactiveFocusedColor : inactiveUnfocusedColor); +*/ //This should only apply to the most innard focus of focusedNode, follow ptrs if (focusPath) XGrabButton(display, AnyButton, AnyModifier, - n -> window, True, ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, None, None); + n -> window, True, ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, None, None); } else { //Recursive loop on children to set @@ -105,17 +105,21 @@ void focusNode(Node * n, XEvent * event, Bool setFocused, Bool focusPath) { n -> parent -> width, n -> parent -> height); } - // Set the Input focus, and ungrab the window (no longer point to click) if (focusPath) { - XSetInputFocus(display, n -> window, RevertToParent, CurrentTime); - XUngrabButton(display, AnyButton, AnyModifier, n ->window); - XRaiseWindow(display, n -> window); + XSetInputFocus(display, n -> window, RevertToParent, CurrentTime); + XUngrabButton(display, AnyButton, AnyModifier, n ->window); + XRaiseWindow(display, n -> window); + if (event) { + // Set the Input focus, and ungrab the window (no longer point to click) XSendEvent(display, n -> window, True, ButtonPressMask, event); } else { + fprintf(stderr, "YO I AM CENTERING POINT on %p !\n\n", n); centerPointer(&n -> window); } } + + } else { fprintf(stderr, "focus called on a container"); Node *i; for (i = n -> child; i; i = i -> next) { @@ -125,6 +129,9 @@ void focusNode(Node * n, XEvent * event, Bool setFocused, Bool focusPath) { } if (setView) placeNode(viewNode, rootX, rootY, rootWidth, rootHeight); + + /* Again why is this needed */ + XFlush(display); } @@ -273,6 +280,9 @@ void placeNode(Node * node, int x, int y, int width, int height) { } } + //Why is this needed + XFlush(display); + } else { //Count up children prior to loop int children = 0; int i = 0; Node *a = NULL;