Subject: Re: bug#5721: Feature request: Function that returns absolute coordinates

From: Jan Djärv <[email-masked]>
Date: Tue, 30 Mar 2010 19:50:42 +0200

IRIE Shinsuke skrev:
> Recently, I wrote pos-tip.el which allows users to easily show tooltip on
> arbitrary buffer position (http://www.emacswiki.org/emacs/PosTip). However,
> external program xwininfo must be called for calculating the absolute
> coordinates in which tooltip is shown because the location of tooltip must
> be specified by absolute coordinates, so this program can work only under X
> window system.
> 
> Some persons say, "We can calculate absolute coordinates by using 
> `frame-parameter' and `window-pixel-edges'", but it's a mistake.
> 
> To calculate absolute coordinates under X window system, users must also
> obtain the pixel height of menu-bar and tool-bar and the pixel width of
> frame extents, because `window-pixel-edges' returns the location of window
> relative to a X window corresponding to `window-id', but `frame-parameter'
> returns the location of a X window corresponding to `outer-window-id' or
> `parent-id'. That is, these two functions regard the different X windows as
> `frame'. Unfortunately, there is no way to obtain the tool-bar height etc.
> without calling external programs such as xwininfo.
> 
> I also encountered this problem when I wrote scim-bridge.el 
> (http://www.emacswiki.org/emacs/ScimBridge) because SCIM requires the 
> clients to send the absolute coordinates of cursor location.
> 
> Please implement the functions like `posn-absolute-x-y', 
> `posn-at-absolute-x-y', and `window-absolute-pixel-edges'.
> 

I can understand posn-absolute-x-y and window-absolute-pixel-edges, but can 
you add some details on what posn-at-absolute-x-y should do?

I'd rather not introduce another position format that looks like the old, but 
where pixels are absolute rather than relative.

	Jan D.