From 86ef6e916e3396e445f89aae92bf1625c389b504 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 28 Jun 2007 10:57:24 -0400 Subject: [PATCH] Fix /ctl reads. --- cmd/wmii/client.c | 4 ++-- cmd/wmii/message.c | 2 +- cmd/wmii/x11.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/wmii/client.c b/cmd/wmii/client.c index 8894afe9..20b58c9c 100644 --- a/cmd/wmii/client.c +++ b/cmd/wmii/client.c @@ -222,10 +222,10 @@ gravclient(Client *c, Rectangle rd) { r = c->sel->r; else r = c->sel->revert; - r = gravitate(r, c->r, h->grav); + r = gravitate(c->r, r, h->grav); if(h->gravstatic) r = rectaddpt(r, sp); - return frame2client(c->sel, r); + return frame2client(nil, r); }else { r = client2frame(nil, rd); r = gravitate(r, rd, h->grav); diff --git a/cmd/wmii/message.c b/cmd/wmii/message.c index 4b145e3e..8cfde6e4 100644 --- a/cmd/wmii/message.c +++ b/cmd/wmii/message.c @@ -351,7 +351,7 @@ read_root_ctl(void) { b = buffer; e = b + sizeof(buffer); -#define print(...) if(b < e) snprintf(b, e-b, __VA_ARGS__) +#define print(...) if(b < e) b += snprintf(b, e-b, __VA_ARGS__) print("view %s\n", screen->sel->name); print("focuscolors %s\n", def.focuscolor.colstr); print("normcolors %s\n", def.normcolor.colstr); diff --git a/cmd/wmii/x11.c b/cmd/wmii/x11.c index b29b2147..a8c33262 100644 --- a/cmd/wmii/x11.c +++ b/cmd/wmii/x11.c @@ -805,5 +805,5 @@ gravitate(Rectangle rc, Rectangle rf, Point grav) { d = divpt(d, Pt(2, 2)); d = mulpt(d, grav); - return rectsubpt(rc, d); + return rectaddpt(rc, d); }