bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Andreas Politz
Subject: bug#5721: Feature request: Function that returns absolute coordinates
Date: Thu, 03 Oct 2013 19:25:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]