diff --git a/src/utils.scm b/src/utils.scm index f7d173e..4b0e3e7 100644 --- a/src/utils.scm +++ b/src/utils.scm @@ -341,13 +341,9 @@ (define (delete-window dpy window time) (let* ((protocols (get-wm-protocols dpy window)) (wm-delete-window (intern-atom dpy "WM_DELETE_WINDOW" #f))) - (if protocols - (if (member wm-delete-window protocols) - (send-protocol-message dpy window wm-delete-window time) - (destroy-window dpy window)) - (begin - (warn "get-wm-protocols #f" dpy window) - (destroy-window dpy window))))) + (if (and protocols (member wm-delete-window protocols)) + (send-protocol-message dpy window wm-delete-window time) + (destroy-window dpy window)))) (define (move-resize-window* dpy window rect) (move-resize-window dpy window @@ -543,8 +539,8 @@ (define (rectangles-overlap? r1 r2) (let ((x1 (rectangle:x r2)) (y1 (rectangle:y r2)) - (x2 (+ (rectangle:x r2) (rectangle:width r2))) - (y2 (+ (rectangle:y r2) (rectangle:height r2)))) + (x2 (+ -1 (rectangle:x r2) (rectangle:width r2))) + (y2 (+ -1 (rectangle:y r2) (rectangle:height r2)))) (any (lambda (p) (point-in-rectangle? r1 (car p) (cdr p))) (list (cons x1 y1) (cons x1 y2) (cons x2 y1) (cons x2 y2)))))