From ad3e6183c2c58e3f3c89af55bd2430aa06894e2c Mon Sep 17 00:00:00 2001 From: frese Date: Sun, 30 Mar 2003 01:43:43 +0000 Subject: [PATCH] fixed resizing in north-west directions --- src/move-wm-resizer.scm | 96 ++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/src/move-wm-resizer.scm b/src/move-wm-resizer.scm index 7a9ecfd..03234b6 100644 --- a/src/move-wm-resizer.scm +++ b/src/move-wm-resizer.scm @@ -88,54 +88,54 @@ (rectangle:width rect) (rectangle:height rect))) (define (adjust-rect wm client sr dx dy dir) - (let* ((r - (case dir - ((west) - (make-rectangle (+ (rectangle:x sr) dx) - (rectangle:y sr) - (- (rectangle:width sr) dx) - (rectangle:height sr))) - ((north-west) - (make-rectangle (+ (rectangle:x sr) dx) - (+ (rectangle:y sr) dy) - (- (rectangle:width sr) dx) - (- (rectangle:height sr) dy))) - ((north) - (make-rectangle (rectangle:x sr) - (+ (rectangle:y sr) dy) - (rectangle:width sr) - (- (rectangle:height sr) dy))) - ((north-east) - (make-rectangle (rectangle:x sr) - (+ (rectangle:y sr) dy) - (+ (rectangle:width sr) dx) - (- (rectangle:height sr) dy))) - ((east) - (make-rectangle (rectangle:x sr) - (rectangle:y sr) - (+ (rectangle:width sr) dx) - (rectangle:height sr))) - ((south-east) - (make-rectangle (rectangle:x sr) - (rectangle:y sr) - (+ (rectangle:width sr) dx) - (+ (rectangle:height sr) dy))) - ((south) - (make-rectangle (rectangle:x sr) - (rectangle:y sr) - (rectangle:width sr) - (+ (rectangle:height sr) dy))) - ((south-west) - (make-rectangle (+ (rectangle:x sr) dx) - (rectangle:y sr) - (- (rectangle:width sr) dx) - (+ (rectangle:height sr) dy))) - (else sr))) - (w.h (maximal-size/hints (wm:dpy wm) (client:window client) - (rectangle:width r) (rectangle:height r)))) - (set-rectangle:width! r (car w.h)) - (set-rectangle:height! r (cdr w.h)) - r)) + (let* ((w.h (maximal-size/hints (wm:dpy wm) (client:window client) + (+ (rectangle:width sr) dx) + (+ (rectangle:height sr) dy))) + (dx (- (car w.h) (rectangle:width sr))) + (dy (- (cdr w.h) (rectangle:height sr)))) + + (case dir + ((west) + (make-rectangle (+ (rectangle:x sr) dx) + (rectangle:y sr) + (- (rectangle:width sr) dx) + (rectangle:height sr))) + ((north-west) + (make-rectangle (+ (rectangle:x sr) dx) + (+ (rectangle:y sr) dy) + (- (rectangle:width sr) dx) + (- (rectangle:height sr) dy))) + ((north) + (make-rectangle (rectangle:x sr) + (+ (rectangle:y sr) dy) + (rectangle:width sr) + (- (rectangle:height sr) dy))) + ((north-east) + (make-rectangle (rectangle:x sr) + (+ (rectangle:y sr) dy) + (+ (rectangle:width sr) dx) + (- (rectangle:height sr) dy))) + ((east) + (make-rectangle (rectangle:x sr) + (rectangle:y sr) + (+ (rectangle:width sr) dx) + (rectangle:height sr))) + ((south-east) + (make-rectangle (rectangle:x sr) + (rectangle:y sr) + (+ (rectangle:width sr) dx) + (+ (rectangle:height sr) dy))) + ((south) + (make-rectangle (rectangle:x sr) + (rectangle:y sr) + (rectangle:width sr) + (+ (rectangle:height sr) dy))) + ((south-west) + (make-rectangle (+ (rectangle:x sr) dx) + (rectangle:y sr) + (- (rectangle:width sr) dx) + (+ (rectangle:height sr) dy))) + (else sr)))) (define (commit-resize wm client dx dy dir) (let* ((dpy (wm:dpy wm))