+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.
XButtonPressedEvent *event = &(dummy.xbutton);
LWLIB_ID menu_id;
Widget menu;
+ Window dummy_window;
eassert (FRAME_X_P (f));
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;
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;