aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/term/bg-mouse.el19
1 files changed, 1 insertions, 18 deletions
diff --git a/lisp/term/bg-mouse.el b/lisp/term/bg-mouse.el
index 8f980c4d9d1..fee358ae25c 100644
--- a/lisp/term/bg-mouse.el
+++ b/lisp/term/bg-mouse.el
@@ -250,27 +250,10 @@ X and Y are 0-based character positions in the window."
250 250
251;;; Returns the window that screen position (x, y) is in or nil if none, 251;;; Returns the window that screen position (x, y) is in or nil if none,
252;;; meaning we are in the echo area with a non-active minibuffer. 252;;; meaning we are in the echo area with a non-active minibuffer.
253;;; If coordinates-in-window-p were not in an X-windows-specific file
254;;; we could use that. In Emacs 19 can even use locate-window-from-coordinates
255(defun bg-window-from-x-y (x y) 253(defun bg-window-from-x-y (x y)
256 "Find window corresponding to screen coordinates. 254 "Find window corresponding to screen coordinates.
257X and Y are 0-based character positions on the screen." 255X and Y are 0-based character positions on the screen."
258 (let ((edges (window-edges)) 256 (some-window (lambda (w) (coordinates-in-window-p (cons x y) w))))
259 (window nil))
260 (while (and (not (eq window (selected-window)))
261 (or (< y (nth 1 edges))
262 (>= y (nth 3 edges))
263 (< x (nth 0 edges))
264 (>= x (nth 2 edges))))
265 (setq window (next-window window))
266 (setq edges (window-edges window)))
267 (cond ((eq window (selected-window))
268 nil) ;we've looped: not found
269 ((not window)
270 (selected-window)) ;just starting: current window
271 (t
272 window))
273 ))
274 257
275(defun bg-command-execute (bg-command) 258(defun bg-command-execute (bg-command)
276 (if (commandp bg-command) 259 (if (commandp bg-command)