From: Eli Zaretskii Date: Sat, 31 Dec 2005 11:47:05 +0000 (+0000) Subject: (mouse-drag-window-above): Verify that the found window overlaps with the X-Git-Tag: emacs-pretest-22.0.90~4950 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5915523a259515bdd832fb3f81e2ac9b70d588d9;p=emacs.git (mouse-drag-window-above): Verify that the found window overlaps with the given window in the horizontal dimension. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e56815a04f0..156c863e8b4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-12-31 Lennart Borgman (tiny change) + + * mouse.el (mouse-drag-window-above): Verify that the found window + overlaps with the given window in the horizontal dimension. + 2005-12-31 Eli Zaretskii * Makefile.in (cvs-update): New target. diff --git a/lisp/mouse.el b/lisp/mouse.el index 186fa438b35..8f0fedf401e 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -355,14 +355,21 @@ This command must be bound to a mouse click." (defun mouse-drag-window-above (window) "Return the (or a) window directly above WINDOW. That means one whose bottom edge is at the same height as WINDOW's top edge." - (let ((top (nth 1 (window-edges window))) + (let ((start-top (nth 1 (window-edges window))) + (start-left (nth 0 (window-edges window))) + (start-right (nth 2 (window-edges window))) (start-window window) above-window) (setq window (previous-window window 0)) (while (and (not above-window) (not (eq window start-window))) - (if (= (+ (window-height window) (nth 1 (window-edges window))) - top) - (setq above-window window)) + (let ((left (nth 0 (window-edges window))) + (right (nth 2 (window-edges window)))) + (when (and (= (+ (window-height window) (nth 1 (window-edges window))) + start-top) + (or (and (<= left start-left) (<= start-right right)) + (and (<= start-left left) (<= left start-right)) + (and (<= start-left right) (<= right start-right)))) + (setq above-window window))) (setq window (previous-window window))) above-window))