fixed resizing in north-west directions

This commit is contained in:
frese 2003-03-30 01:43:43 +00:00
parent 1ef21b5897
commit ad3e6183c2
1 changed files with 48 additions and 48 deletions

View File

@ -88,54 +88,54 @@
(rectangle:width rect) (rectangle:height rect))) (rectangle:width rect) (rectangle:height rect)))
(define (adjust-rect wm client sr dx dy dir) (define (adjust-rect wm client sr dx dy dir)
(let* ((r (let* ((w.h (maximal-size/hints (wm:dpy wm) (client:window client)
(case dir (+ (rectangle:width sr) dx)
((west) (+ (rectangle:height sr) dy)))
(make-rectangle (+ (rectangle:x sr) dx) (dx (- (car w.h) (rectangle:width sr)))
(rectangle:y sr) (dy (- (cdr w.h) (rectangle:height sr))))
(- (rectangle:width sr) dx)
(rectangle:height sr))) (case dir
((north-west) ((west)
(make-rectangle (+ (rectangle:x sr) dx) (make-rectangle (+ (rectangle:x sr) dx)
(+ (rectangle:y sr) dy) (rectangle:y sr)
(- (rectangle:width sr) dx) (- (rectangle:width sr) dx)
(- (rectangle:height sr) dy))) (rectangle:height sr)))
((north) ((north-west)
(make-rectangle (rectangle:x sr) (make-rectangle (+ (rectangle:x sr) dx)
(+ (rectangle:y sr) dy) (+ (rectangle:y sr) dy)
(rectangle:width sr) (- (rectangle:width sr) dx)
(- (rectangle:height sr) dy))) (- (rectangle:height sr) dy)))
((north-east) ((north)
(make-rectangle (rectangle:x sr) (make-rectangle (rectangle:x sr)
(+ (rectangle:y sr) dy) (+ (rectangle:y sr) dy)
(+ (rectangle:width sr) dx) (rectangle:width sr)
(- (rectangle:height sr) dy))) (- (rectangle:height sr) dy)))
((east) ((north-east)
(make-rectangle (rectangle:x sr) (make-rectangle (rectangle:x sr)
(rectangle:y sr) (+ (rectangle:y sr) dy)
(+ (rectangle:width sr) dx) (+ (rectangle:width sr) dx)
(rectangle:height sr))) (- (rectangle:height sr) dy)))
((south-east) ((east)
(make-rectangle (rectangle:x sr) (make-rectangle (rectangle:x sr)
(rectangle:y sr) (rectangle:y sr)
(+ (rectangle:width sr) dx) (+ (rectangle:width sr) dx)
(+ (rectangle:height sr) dy))) (rectangle:height sr)))
((south) ((south-east)
(make-rectangle (rectangle:x sr) (make-rectangle (rectangle:x sr)
(rectangle:y sr) (rectangle:y sr)
(rectangle:width sr) (+ (rectangle:width sr) dx)
(+ (rectangle:height sr) dy))) (+ (rectangle:height sr) dy)))
((south-west) ((south)
(make-rectangle (+ (rectangle:x sr) dx) (make-rectangle (rectangle:x sr)
(rectangle:y sr) (rectangle:y sr)
(- (rectangle:width sr) dx) (rectangle:width sr)
(+ (rectangle:height sr) dy))) (+ (rectangle:height sr) dy)))
(else sr))) ((south-west)
(w.h (maximal-size/hints (wm:dpy wm) (client:window client) (make-rectangle (+ (rectangle:x sr) dx)
(rectangle:width r) (rectangle:height r)))) (rectangle:y sr)
(set-rectangle:width! r (car w.h)) (- (rectangle:width sr) dx)
(set-rectangle:height! r (cdr w.h)) (+ (rectangle:height sr) dy)))
r)) (else sr))))
(define (commit-resize wm client dx dy dir) (define (commit-resize wm client dx dy dir)
(let* ((dpy (wm:dpy wm)) (let* ((dpy (wm:dpy wm))