GNU bug report logs - #5721
Feature request: Function that returns absolute coordinates

Previous Next

Package: emacs;

Reported by: irieshinsuke <at> yahoo.co.jp

Date: Mon, 15 Mar 2010 14:34:02 UTC

Severity: wishlist

Done: Jan Djärv <jan.h.d <at> swipnet.se>

Bug is archived. No further changes may be made.

Full log


Message #118 received at 5721 <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: 5721 <at> debbugs.gnu.org, IRIE Shinsuke <irieshinsuke <at> yahoo.co.jp>
Subject: Re: bug#5721: Feature request: Function that returns absolute
	coordinates
Date: Fri, 16 Jul 2010 09:35:54 +0900
>>>>> On Thu, 15 Jul 2010 12:56:38 +0200, Jan Djärv <jan.h.d <at> swipnet.se> said:

>> It seems to be difficult to reach agreement about absolete unscaled
>> vs. absolute scaled.  Fortunately, that doesn't matter for X11
>> currently, and we agree with the necessity of a special function
>> that returns absolute unscaled coordinates to pass to an external
>> program.  Why don't we start discussing the specification of that
>> special function, letting absolute unscaled vs. absolute scaled
>> aside for now?
>> 
>> My proposal was to make it parallel to posn-at-x-y, as I mentioned.
>> 
>> (posn-at-x-y x y &optional frame-or-window whole)
>> 

> Sure.  Please check the ifdefs in the window absolute functions I
> made to see the various differences w.r.t tool bar and menu bar.

I don't think such ifdefs are necessary.  The strategy I'm thinking of
is:

  1) Convert window coordinates to frame coordinates if the third
     argument is not a frame.  This should be similar to the code in
     pos-at-x-y.
  2) Call a terminal-specific function that converts frame-relative
     coordinates to absolute coordinates.  That can be done by the
     following "idiom".

       x += f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
       y += f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);

     on X11 and

       ClientToScreen (FRAME_W32_WINDOW (f), &pt)

     on W32, I guess.

By the way, window-(inside-)absolute-pixel-edges doesn't seem to take
account of title bar height.  Is that correct?

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp




This bug report was last modified 11 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.