foo-wm

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

commit 239c86455237c7e342eb50b88006a03de513f9f3
parent dd6a7a30b6e0e8c6d88ac77a83dc313f57c6e5ee
Author: Miles Sandlar <miles.sandlar@gmail.com>
Date:   Tue, 20 Nov 2012 22:14:33 -0500

Un-necessary \0 in sprintf

Diffstat:
Mscripts/uncontainerize.rb | 2+-
Msrc/responses.c | 2+-
Msrc/tree.c | 10+++-------
3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/scripts/uncontainerize.rb b/scripts/uncontainerize.rb @@ -2,7 +2,7 @@ require 'socket' require 'json' require 'pp' -$socketPath = "/tmp/stable-wm.socket" +$socketPath = "/tmp/foo-wm.socket" def sendCommand(command) response = "" diff --git a/src/responses.c b/src/responses.c @@ -65,7 +65,7 @@ char * jsonTree(Node * node, int level) { /* Print to the buffer */ sprintf(buffer, /* Type (Pointer) (?Layout) (?R/V/F) (?ChildFocus) */ - "{ \"node\":\"%p\",\"id\":\"%d\",\"type\":\"%s\"%s%s%s%s,\"focus\":\"%p\",\"children\":[%s]}\0", + "{ \"node\":\"%p\",\"id\":\"%d\",\"type\":\"%s\"%s%s%s%s,\"focus\":\"%p\",\"children\":[%s]}", node, node -> id, isClient(node) ? "client" : "container", diff --git a/src/tree.c b/src/tree.c @@ -263,15 +263,11 @@ void focusNode(Node * n, XEvent * event, Bool setFocused, Bool focusPath) { focusedNode = n; if (oldFocus && nodeIsParentOf(viewNode, oldFocus)) - rePlaceNode(oldFocus); - - if (oldFocus == viewNode && nodeIsParentOf(focusedNode, viewNode)) { + rePlaceNode(oldFocus); + if (oldFocus == viewNode && nodeIsParentOf(focusedNode, viewNode)) viewNode = n; - } - - if (areBrothers(oldFocus, focusedNode)) { + if (areBrothers(oldFocus, focusedNode)) placeNode(focusedNode, oldFocus -> x, oldFocus -> y, oldFocus -> width, oldFocus -> height); - } placeNode(viewNode, rootX, rootY, rootWidth, rootHeight);