summaryrefslogtreecommitdiff
path: root/src/xterm.h
diff options
context:
space:
mode:
authorJan D <jhd@f20.localdomain>2015-02-25 20:16:44 +0100
committerJan D <jhd@f20.localdomain>2015-02-25 20:16:44 +0100
commit719fd9334634dfc91e145d0a7320387a8bb4b75f (patch)
treef8291b946d6c23dd60b564dda4ccae43a7a70c9a /src/xterm.h
parent0731a2e857f6d328a06a12d9d7540f41f3a8ae04 (diff)
downloademacs-719fd9334634dfc91e145d0a7320387a8bb4b75f.tar.gz
emacs-719fd9334634dfc91e145d0a7320387a8bb4b75f.tar.bz2
emacs-719fd9334634dfc91e145d0a7320387a8bb4b75f.zip
Redo the whole window offsets and coordinate translation for X.
* frame.h (struct frame): Remove x_pixels_diff, y_pixels_diff. * w32fns.c (x_real_positions): Remove setting of x_pixels_diff, y_pixels_diff. * xfns.c (x_real_pos_and_offsets): New function, basically the code from x_real_positions. (x_real_positions): Call x_real_pos_and_offsets. (x_relative_mouse_position): Use XTranslateCoordinates instead of OUTER_TO_INNER_DIFF macros. (Fx_frame_geometry): Get offsets with x_real_pos_and_offsets, border from window attributes. Adjust tool bar and menu widths. * xmenu.c (create_and_show_popup_menu): Use XTranslateCoordinates instead of OUTER_TO_INNER_DIFF macros. * xterm.h (struct x_output): Remove x_pixels_outer_diff, y_pixels_outer_diff, FRAME_OUTER_TO_INNER_DIFF_X, FRAME_OUTER_TO_INNER_DIFF_Y. Declare x_real_pos_and_offsets.
Diffstat (limited to 'src/xterm.h')
-rw-r--r--src/xterm.h28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/xterm.h b/src/xterm.h
index e597227c81c..16868f114e8 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -628,15 +628,6 @@ struct x_output
They are changed only when a different background is involved. */
unsigned long relief_background;
- /* As x_pixels_diff, but to FRAME_OUTER_WINDOW. For some reason the
- two might differ by a pixel, depending on WM */
- int x_pixels_outer_diff;
-
- /* As y_pixels_diff, but to FRAME_OUTER_WINDOW. In the toolkit version,
- these may differ because this does not take into account possible
- menubar. y_pixels_diff is with menubar height included */
- int y_pixels_outer_diff;
-
/* Keep track of focus. May be EXPLICIT if we received a FocusIn for this
frame, or IMPLICIT if we received an EnterNotify.
FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */
@@ -759,16 +750,6 @@ enum
/* This is the Colormap which frame F uses. */
#define FRAME_X_COLORMAP(f) FRAME_DISPLAY_INFO (f)->cmap
-/* The difference in pixels between the top left corner of the
- Emacs window (including possible window manager decorations)
- and FRAME_X_WINDOW (f). */
-#define FRAME_OUTER_TO_INNER_DIFF_X(f) \
- ((f)->output_data.x->x_pixels_outer_diff)
-#define FRAME_OUTER_TO_INNER_DIFF_Y(f) \
- ((f)->output_data.x->y_pixels_outer_diff \
- + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
-
-
#define FRAME_XIC(f) ((f)->output_data.x->xic)
#define FRAME_X_XIM(f) (FRAME_DISPLAY_INFO (f)->xim)
#define FRAME_X_XIM_STYLES(f) (FRAME_DISPLAY_INFO (f)->xim_styles)
@@ -971,6 +952,15 @@ SELECTION_EVENT_DISPLAY (struct input_event *ev)
extern void x_free_gcs (struct frame *);
extern void x_relative_mouse_position (struct frame *, int *, int *);
+extern void x_real_pos_and_offsets (struct frame *f,
+ int *left_offset_x,
+ int *right_offset_x,
+ int *top_offset_y,
+ int *bottom_offset_y,
+ int *x_pixels_diff,
+ int *y_pixels_diff,
+ int *xptr,
+ int *yptr);
/* From xrdb.c. */