foo-wm

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

commit d4aaba5f0668a7eca132ad1bc7beffe03f63f50d
parent 3717a23b82f1a1d335542d8cda4ed274a68bb919
Author: Miles Sandlar <miles.sandlar@gmail.com>
Date:   Thu, 28 Jun 2012 23:52:31 -0400

currentContainer -> active == currentClient
Eliminated redundancy in tracking current client
Only track container as each container has an active client

Diffstat:
Msrc/client.c | 6------
Msrc/commands.c | 4++--
Msrc/events.c | 1-
Msrc/fifo-wm.h | 1-
4 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/client.c b/src/client.c @@ -11,19 +11,13 @@ void focusClient(Client *client) { Client *c; for (c = (client -> parent) -> client; c != NULL; c = c -> next) { - if (client == c) { XSetWindowBorder(display, client -> window, focusedColor); - XSetWindowBorderWidth(display, client -> window, 2); - } else { XSetWindowBorder(display, c -> window, unfocusedColor); - XSetWindowBorderWidth(display, c -> window, 0); - } } - (client -> parent) -> focus = client; //Focuses window diff --git a/src/commands.c b/src/commands.c @@ -37,10 +37,10 @@ void handleCommand(char* request) { currentContainer -> width, currentContainer -> height); } else if (!strcmp(tokens[0], "containerize")) { - if (currentClient -> previous != NULL) { + if ((currentContainer -> focus) -> previous != NULL) { fprintf(stderr, "Containerizing!"); Container * newContainer = malloc(sizeof(Container)); - parentClient(currentClient, newContainer); + parentClient((currentContainer -> focus) , newContainer); parentContainer(newContainer, currentContainer); currentContainer = newContainer; } else { diff --git a/src/events.c b/src/events.c @@ -24,7 +24,6 @@ void eMapRequest(XEvent *event) { fprintf(stderr, "Got a map request\n"); parentClient(newClient, currentContainer); - currentClient = newClient; //Update view placeContainer( diff --git a/src/fifo-wm.h b/src/fifo-wm.h @@ -3,7 +3,6 @@ Container * rootContainer; Container * currentContainer; -Client * currentClient; Lookup * lookup; int screen, activeScreen;