tsimplification - dwm - [fork] customized build of dwm, the dynamic window mana… | |
git clone git://src.adamsgaard.dk/dwm | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit dafbd0dcb00366e9ef36079e30d8338b199b8034 | |
parent 2ddc78720aceda76e22fd3584740fc86a2e7c677 | |
Author: Anselm R. Garbe <[email protected]> | |
Date: Tue, 6 Feb 2007 15:28:25 +0100 | |
simplification | |
Diffstat: | |
M client.c | 15 +++++---------- | |
1 file changed, 5 insertions(+), 10 deletions(-) | |
--- | |
diff --git a/client.c b/client.c | |
t@@ -10,13 +10,6 @@ | |
/* static */ | |
static void | |
-closestpt(float *rx, float *ry, float x, float y, float grad) { | |
- float u = (x * grad + y) / (grad * grad + 1); | |
- *rx = u * grad; | |
- *ry = u; | |
-} | |
- | |
-static void | |
detachstack(Client *c) { | |
Client **tc; | |
for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext); | |
t@@ -191,7 +184,7 @@ manage(Window w, XWindowAttributes *wa) { | |
void | |
resize(Client *c, Bool sizehints) { | |
- float dx, dy, min, max, actual; | |
+ float actual, dx, dy, max, min, u; | |
XWindowChanges wc; | |
if(c->w <= 0 || c->h <= 0) | |
t@@ -214,12 +207,14 @@ resize(Client *c, Bool sizehints) { | |
actual = dx / dy; | |
if(max > 0 && min > 0 && actual > 0) { | |
if(actual < min) { | |
- closestpt(&dx, &dy, dx, dy, min); | |
+ dy = (dx * min + dy) / (min * min + 1); | |
+ dx = dy * min; | |
c->w = (int)dx + c->basew; | |
c->h = (int)dy + c->baseh; | |
} | |
else if(actual > max) { | |
- closestpt(&dx, &dy, dx, dy, max); | |
+ dy = (dx * min + dy) / (max * max + 1); | |
+ dx = dy * min; | |
c->w = (int)dx + c->basew; | |
c->h = (int)dy + c->baseh; | |
} |