Function: x-dnd-get-drop-width-height
x-dnd-get-drop-width-height is a byte-compiled function defined in
x-dnd.el.gz.
Signature
(x-dnd-get-drop-width-height FRAME W ACCEPT)
Documentation
Return the width/height to be sent in a XDndStatus message.
FRAME is the frame and W is the window where the drop happened. If ACCEPT is nil return 0 (empty rectangle), otherwise if W is a window, return its width/height, otherwise return the frame width/height.
Source Code
;; Defined in /usr/src/emacs/lisp/x-dnd.el.gz
(defun x-dnd-get-drop-width-height (frame w accept)
"Return the width/height to be sent in a XDndStatus message.
FRAME is the frame and W is the window where the drop happened.
If ACCEPT is nil return 0 (empty rectangle),
otherwise if W is a window, return its width/height,
otherwise return the frame width/height."
(if accept
(if (windowp w) ;; w is not a window if dropping on the menu bar,
;; scroll bar or tool bar.
(let ((edges (window-inside-pixel-edges w)))
(cons
(- (nth 2 edges) (nth 0 edges)) ;; right - left
(- (nth 3 edges) (nth 1 edges)))) ;; bottom - top
(cons (frame-pixel-width frame)
(frame-pixel-height frame)))
0))