summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2015-02-26 16:42:03 +0100
committerJan Djärv <jan.h.d@swipnet.se>2015-02-26 16:42:03 +0100
commit5917b7907ad0cdc38f14967d16aa8472be572e3f (patch)
treefe1c119598c6652a8c3dbcb65c2940a3cf8b06f6
parent0ed52489b93648ea278bfb1ba12f351c48ab60dd (diff)
Don't use OUTER_TO_INNER macros for plain X and lucid.
* xmenu.c (create_and_show_popup_menu): Call XTranslateCoordinates, dont use OUTER_TO_INNER macros. (x_menu_show): Call x_real_pos_and_offsets, don't use OUTER_TO_INNER macros.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/xmenu.c31
2 files changed, 32 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f0ec092c06..bf4043666c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-26 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (create_and_show_popup_menu): Call XTranslateCoordinates,
+ dont use OUTER_TO_INNER macros.
+ (x_menu_show): Call x_real_pos_and_offsets, don't use
+ OUTER_TO_INNER macros.
+
2015-02-26 Eli Zaretskii <eliz@gnu.org>
* dispextern.h (FACE_FOR_CHAR): Fix the commentary.
diff --git a/src/xmenu.c b/src/xmenu.c
index c9f150f67f..5794f12ccb 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1313,6 +1313,7 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
XButtonPressedEvent *event = &(dummy.xbutton);
LWLIB_ID menu_id;
Widget menu;
+ Window dummy_window;
eassert (FRAME_X_P (f));
@@ -1338,8 +1339,20 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
event->y = y;
/* Adjust coordinates to be root-window-relative. */
- x += f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
- y += f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
+ block_input ();
+ x += FRAME_LEFT_SCROLL_BAR_AREA_WIDTH (f);
+ XTranslateCoordinates (FRAME_X_DISPLAY (f),
+
+ /* From-window, to-window. */
+ FRAME_X_WINDOW (f),
+ FRAME_DISPLAY_INFO (f)->root_window,
+
+ /* From-position, to-position. */
+ x, y, &x, &y,
+
+ /* Child of win. */
+ &dummy_window);
+ unblock_input ();
event->x_root = x;
event->y_root = y;
@@ -2059,12 +2072,18 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
inhibit_garbage_collection ();
#ifdef HAVE_X_WINDOWS
- /* Adjust coordinates to relative to the outer (window manager) window. */
- x += FRAME_OUTER_TO_INNER_DIFF_X (f);
- y += FRAME_OUTER_TO_INNER_DIFF_Y (f);
+ {
+ /* Adjust coordinates to relative to the outer (window manager) window. */
+ int left_off, top_off;
+
+ x_real_pos_and_offsets (f, &left_off, NULL, &top_off, NULL,
+ NULL, NULL, NULL, NULL);
+
+ x += left_off;
+ y += top_off;
+ }
#endif /* HAVE_X_WINDOWS */
- /* Adjust coordinates to be root-window-relative. */
x += f->left_pos;
y += f->top_pos;