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)))
(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))