Function: x-dnd-get-window-rectangle

x-dnd-get-window-rectangle is a byte-compiled function defined in x-dnd.el.gz.

Signature

(x-dnd-get-window-rectangle WINDOW)

Documentation

Return the bounds of WINDOW as a rectangle.

The coordinates in the rectangle are relative to its frame's root window. Return the bounds as a list of (X Y WIDTH HEIGHT).

Source Code

;; Defined in /usr/src/emacs/lisp/x-dnd.el.gz
(defun x-dnd-get-window-rectangle (window)
  "Return the bounds of WINDOW as a rectangle.
The coordinates in the rectangle are relative to its frame's root
window.  Return the bounds as a list of (X Y WIDTH HEIGHT)."
  (let* ((frame (window-frame window))
         (frame-pos (x-dnd-compute-root-window-position frame))
         (edges (window-inside-pixel-edges window)))
    (list (+ (car frame-pos) (nth 0 edges))
          (+ (cdr frame-pos) (nth 1 edges))
          (- (nth 2 edges) (nth 0 edges))
          (- (nth 3 edges) (nth 1 edges)))))