aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2015-02-26 16:42:03 +0100
committerJan Djärv2015-02-26 16:42:03 +0100
commit5917b7907ad0cdc38f14967d16aa8472be572e3f (patch)
treefe1c119598c6652a8c3dbcb65c2940a3cf8b06f6 /src
parent0ed52489b93648ea278bfb1ba12f351c48ab60dd (diff)
downloademacs-5917b7907ad0cdc38f14967d16aa8472be572e3f.tar.gz
emacs-5917b7907ad0cdc38f14967d16aa8472be572e3f.zip
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.
Diffstat (limited to 'src')
-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 f0ec092c068..bf4043666c6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12015-02-26 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xmenu.c (create_and_show_popup_menu): Call XTranslateCoordinates,
4 dont use OUTER_TO_INNER macros.
5 (x_menu_show): Call x_real_pos_and_offsets, don't use
6 OUTER_TO_INNER macros.
7
12015-02-26 Eli Zaretskii <eliz@gnu.org> 82015-02-26 Eli Zaretskii <eliz@gnu.org>
2 9
3 * dispextern.h (FACE_FOR_CHAR): Fix the commentary. 10 * dispextern.h (FACE_FOR_CHAR): Fix the commentary.
diff --git a/src/xmenu.c b/src/xmenu.c
index c9f150f67f3..5794f12ccb7 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,
1313 XButtonPressedEvent *event = &(dummy.xbutton); 1313 XButtonPressedEvent *event = &(dummy.xbutton);
1314 LWLIB_ID menu_id; 1314 LWLIB_ID menu_id;
1315 Widget menu; 1315 Widget menu;
1316 Window dummy_window;
1316 1317
1317 eassert (FRAME_X_P (f)); 1318 eassert (FRAME_X_P (f));
1318 1319
@@ -1338,8 +1339,20 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
1338 event->y = y; 1339 event->y = y;
1339 1340
1340 /* Adjust coordinates to be root-window-relative. */ 1341 /* Adjust coordinates to be root-window-relative. */
1341 x += f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f); 1342 block_input ();
1342 y += f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f); 1343 x += FRAME_LEFT_SCROLL_BAR_AREA_WIDTH (f);
1344 XTranslateCoordinates (FRAME_X_DISPLAY (f),
1345
1346 /* From-window, to-window. */
1347 FRAME_X_WINDOW (f),
1348 FRAME_DISPLAY_INFO (f)->root_window,
1349
1350 /* From-position, to-position. */
1351 x, y, &x, &y,
1352
1353 /* Child of win. */
1354 &dummy_window);
1355 unblock_input ();
1343 1356
1344 event->x_root = x; 1357 event->x_root = x;
1345 event->y_root = y; 1358 event->y_root = y;
@@ -2059,12 +2072,18 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
2059 inhibit_garbage_collection (); 2072 inhibit_garbage_collection ();
2060 2073
2061#ifdef HAVE_X_WINDOWS 2074#ifdef HAVE_X_WINDOWS
2062 /* Adjust coordinates to relative to the outer (window manager) window. */ 2075 {
2063 x += FRAME_OUTER_TO_INNER_DIFF_X (f); 2076 /* Adjust coordinates to relative to the outer (window manager) window. */
2064 y += FRAME_OUTER_TO_INNER_DIFF_Y (f); 2077 int left_off, top_off;
2078
2079 x_real_pos_and_offsets (f, &left_off, NULL, &top_off, NULL,
2080 NULL, NULL, NULL, NULL);
2081
2082 x += left_off;
2083 y += top_off;
2084 }
2065#endif /* HAVE_X_WINDOWS */ 2085#endif /* HAVE_X_WINDOWS */
2066 2086
2067 /* Adjust coordinates to be root-window-relative. */
2068 x += f->left_pos; 2087 x += f->left_pos;
2069 y += f->top_pos; 2088 y += f->top_pos;
2070 2089