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

From: Andreas Politz <[email-masked]>
Date: Thu, 03 Oct 2013 19:25:06 +0200

Hi,

I made another patch, see below.  I build it with GTK and X-tool-kit and
tested it on Xmonad, fluxbox and compiz, also on Windows 7.  In all
cases `window-inside-absolute-pixel-edges' seems to report the correct
x-y values, i.e. the absolute position of the beginning of the text
area.

=== modified file 'src/window.c'
*** src/window.c	2013-10-02 12:08:27 +0000
--- src/window.c	2013-10-03 17:06:53 +0000
***************
*** 940,945 ****
--- 940,950 ----
  {
    struct frame *f = XFRAME (w->frame);
    *add_y = f->top_pos;
+ #ifdef HAVE_X_WINDOWS
+   *add_y += FRAME_X_OUTPUT (f)->y_pixels_outer_diff;
+ #elif defined (WINDOWSNT)
+   *add_y += f->y_pixels_diff;
+ #endif
  #ifdef FRAME_MENUBAR_HEIGHT
    *add_y += FRAME_MENUBAR_HEIGHT (f);
  #endif
***************
*** 951,957 ****
--- 956,968 ----
  #ifdef FRAME_NS_TITLEBAR_HEIGHT
    *add_y += FRAME_NS_TITLEBAR_HEIGHT (f);
  #endif
+ 
    *add_x = f->left_pos;
+ #ifdef HAVE_X_WINDOWS
+   *add_x += FRAME_X_OUTPUT (f)->x_pixels_outer_diff;
+ #elif defined (WINDOWSNT)
+   *add_x += f->x_pixels_diff;
+ #endif
  #ifdef FRAME_TOOLBAR_LEFT_WIDTH
    *add_x += FRAME_TOOLBAR_LEFT_WIDTH (f);
  #endif

-ap