foo-wm

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

commit 320dee1bd580c533ac7987f4f0ef4846ba99e19d
parent 2e0047ec7a2a8e8f748eff1e7922b141652861b9
Author: Miles Sandlar <miles.sandlar@gmail.com>
Date:   Sun, 25 Nov 2012 10:32:24 -0500

Added dimensions command to commands.c

Diffstat:
Msrc/commands.c | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/commands.c b/src/commands.c @@ -22,6 +22,10 @@ char * handleCommand(char * request) { char * response = "Some arbitrary response back to the socket\0"; + if (!strcmp(tokens[0], "dimensions")) + dimensions(tokens[1], tokens[2]); + + if (!strcmp(tokens[0], "absorb")) absorb(tokens[1], tokens[2]); if (!strcmp(tokens[0], "containerize")) @@ -68,6 +72,16 @@ char * nextToken(char ** tokenString) { /* ----------------------------------------------------------------------------- * IPC Commands * ---------------------------------------------------------------------------*/ +void dimensions(char * w, char * h) { + int width = atoi(w); + int height = atoi(h); + rootNode -> x = rootX = screenPaddingLeft; + rootNode -> y = rootY = screenPaddingTop; + rootNode -> width = rootWidth = width - screenPaddingLeft - screenPaddingRight; + rootNode -> height = rootHeight = height - screenPaddingTop - screenPaddingBottom; +} + + void absorb(char * argA, char * argB) { /* Absorbs the given node into the container of the focused node * If the focused node is a client, containerize will be called then absorb