Function: posframe-refposhandler-xwininfo

posframe-refposhandler-xwininfo is a byte-compiled function defined in posframe.el.

Signature

(posframe-refposhandler-xwininfo &optional FRAME)

Documentation

Parent FRAME poshander function.

Get the position of parent frame (current frame) with the help of xwininfo.

Source Code

;; Defined in ~/.emacs.d/elpa/posframe-20260415.14/posframe.el
(defun posframe-refposhandler-xwininfo (&optional frame)
  "Parent FRAME poshander function.
Get the position of parent frame (current frame) with the help of
xwininfo."
  (when (executable-find "xwininfo")
    (with-temp-buffer
      (let ((case-fold-search nil))
        (call-process "xwininfo" nil t nil
                      "-display" (frame-parameter frame 'display)
                      "-id"  (frame-parameter frame 'window-id))
        (goto-char (point-min))
        (search-forward "Absolute upper-left")
        (let ((x (string-to-number
                  (buffer-substring-no-properties
                   (search-forward "X: ")
                   (line-end-position))))
              (y (string-to-number
                  (buffer-substring-no-properties
                   (search-forward "Y: ")
                   (line-end-position)))))
          (cons x y))))))