(defun sup-pos-to-window (x y)
"Find window corresponding to frame coordinates.
X and Y are 0-based character positions on the frame."
- (let ((edges (window-edges))
- (window nil))
- (while (and (not (eq window (selected-window)))
- (or (< y (nth 1 edges))
- (>= y (nth 3 edges))
- (< x (nth 0 edges))
- (>= x (nth 2 edges))))
- (setq window (next-window window))
- (setq edges (window-edges window))
- )
- (or window (selected-window))
- )
- )
+ (some-window (lambda (w) (coordinates-in-window-p (cons x y) w))))
;;; sup-mouse.el ends here