I need to get the coordinate of point for childframe and currently my approach is this (copied from the manual):
(let* ((pos (posn-at-point point window)) (x-y (posn-x-y pos)) (window (posn-window pos)) (edges (window-body-pixel-edges window))) (cons (+ (car x-y) (car edges)) (+ (cdr x-y) (cadr edges))))
This worked well for the most part, but the coordinate is off when I enable ‘tool-bar-mode’ on NS build in Emacs 27 which is odd. Because according to the manual, tool-bar is not included in the native frame for NS and GTK+ build, and IIUC childframe's coordinate is relative to the native frame.
Anyhow, I just want to know if there is a reliable/portable way to get the coordinate of the point that can be used for childframe.
P.S. My Emacs build:
GNU Emacs 27.0.50 (build1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G103)) of 2019-10-08```