Function: x-dnd-get-object-rectangle
x-dnd-get-object-rectangle is a byte-compiled function defined in
x-dnd.el.gz.
Signature
(x-dnd-get-object-rectangle WINDOW POSN)
Documentation
Return the rectangle of the object (character or image) under POSN.
WINDOW is the window POSN represents. The rectangle is returned with coordinates relative to the root window.
Source Code
;; Defined in /usr/src/emacs/lisp/x-dnd.el.gz
(defun x-dnd-get-object-rectangle (window posn)
"Return the rectangle of the object (character or image) under POSN.
WINDOW is the window POSN represents. The rectangle is returned
with coordinates relative to the root window."
(if (posn-point posn)
(with-selected-window window
(if-let* ((new-posn (posn-at-point (posn-point posn)))
(posn-x-y (posn-x-y new-posn))
(object-width-height (posn-object-width-height new-posn))
(edges (window-inside-pixel-edges window))
(frame-pos (x-dnd-compute-root-window-position
(window-frame window))))
(list (+ (car frame-pos) (car posn-x-y)
(car edges))
(+ (cdr frame-pos) (cdr posn-x-y)
(cadr edges))
(car object-width-height)
(cdr object-width-height))
'(0 0 0 0)))
'(0 0 0 0)))