foo-wm

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

commit 1d32821a50b673f377123662437c0f0aec5cf6f2
parent d767488a0a0fd5d842fd128742355ff082286a50
Author: Miles Sandlar <miles.sandlar@gmail.com>
Date:   Sun, 22 Jul 2012 01:00:09 -0400

Removing faulted fullscreen implementation

Diffstat:
Msrc/commands.c | 11+----------
Msrc/fifo-wm.c | 20++++++++++++--------
Msrc/structs.h | 1-
Msrc/tree.c | 5+----
Msrc/util.c | 1-
5 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/src/commands.c b/src/commands.c @@ -121,9 +121,7 @@ void move(int amount) { /* Updates the viewNode approximating the current focusNode */ void zoom(int level) { while (level < 0) { - if (viewNode -> fullscreen) { - viewNode -> fullscreen = False; - } else if (viewNode -> parent) { unmapNode(viewNode); + if (viewNode -> parent) { unmapNode(viewNode); viewNode = viewNode -> parent; placeNode(viewNode, rootX, rootY, rootWidth, rootHeight); focusNode(focusedNode, NULL); @@ -141,13 +139,6 @@ void zoom(int level) { unmapNode(viewNode); viewNode = n; placeNode(viewNode, rootX, rootY, rootWidth, rootHeight); - } else if (!viewNode -> fullscreen) { - fprintf(stderr, "Maxing"); - placeNode(viewNode, 0, 0, - DisplayWidth(display, activeScreen), - DisplayHeight(display, activeScreen)); - viewNode -> fullscreen = True; - } else { return; } level--; } diff --git a/src/fifo-wm.c b/src/fifo-wm.c @@ -45,9 +45,9 @@ void handleEvents(void) { void setup(void) { // Setting from defines from config.h - layout = CONTAINER_DEFAULT_LAYOUT; + layout = CONTAINER_DEFAULT_LAYOUT; containerPadding = CONTAINER_PADDING; - clientPadding = CLIENT_PADDING; + clientPadding = CLIENT_PADDING; // Open Display and set acitveScreen assert((display = XOpenDisplay(NULL))); @@ -57,8 +57,10 @@ void setup(void) { root = RootWindow(display, activeScreen); rootX = SCREEN_PADDING_LEFT; rootY = SCREEN_PADDING_TOP; - rootWidth = DisplayWidth(display, activeScreen) - SCREEN_PADDING_LEFT - SCREEN_PADDING_RIGHT; - rootHeight = DisplayHeight(display, activeScreen) - SCREEN_PADDING_TOP - SCREEN_PADDING_BOTTOM; + rootWidth = DisplayWidth(display, activeScreen) + - SCREEN_PADDING_LEFT - SCREEN_PADDING_RIGHT; + rootHeight = DisplayHeight(display, activeScreen) + - SCREEN_PADDING_TOP - SCREEN_PADDING_BOTTOM; XSelectInput(display, root, SubstructureRedirectMask | SubstructureNotifyMask); setCursor(&root, 68); @@ -69,11 +71,13 @@ void setup(void) { unfocusedColor = getColor(CLIENT_UNFOCUSED_COLOR); // Setup the Root Node (top of tree) - rootNode = allocateNode(); + rootNode = allocateNode(); rootNode -> layout = layout; - rootNode -> x = rootX; rootNode -> y = rootY; - rootNode -> width = rootWidth; rootNode-> height = rootHeight; - viewNode = rootNode; + rootNode -> x = rootX; + rootNode -> y = rootY; + rootNode -> width = rootWidth; + rootNode -> height = rootHeight; + viewNode = rootNode; // Set Error Handlers and Flush to X XSetErrorHandler((XErrorHandler)(xError)); diff --git a/src/structs.h b/src/structs.h @@ -17,7 +17,6 @@ struct Node { /* If a Container */ Node *child; - Bool fullscreen; //Node *focus; /* If a Client */ diff --git a/src/tree.c b/src/tree.c @@ -221,15 +221,12 @@ void placeNode(Node * node, int x, int y, int width, int height) { fprintf(stderr,"Rendering window\n"); XMapWindow(display, node -> window); XRaiseWindow(display, node -> window); - XMoveResizeWindow(display, node -> window, (x < 0) ? 0 : x, (y < 0) ? 0 : y, (width - (border * 2)) > 0 ? (width - border * 2) : 1, (height - (border * 2)) > 0 ? (height- border * 2) : 1); - XSetWindowBorderWidth(display, node -> window, - (node -> fullscreen ? 0 : border) - ); + XSetWindowBorderWidth(display, node -> window, border); XSetWindowBorder(display, node -> window, (focusedNode == node ? focusedColor : unfocusedColor)); diff --git a/src/util.c b/src/util.c @@ -30,7 +30,6 @@ Node * allocateNode() { n -> focus = NULL; n -> window = (Window) NULL; n -> layout = layout; - n -> fullscreen = False; return n; }