summaryrefslogtreecommitdiff
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1993-01-29 22:13:36 +0000
committerJim Blandy <jimb@redhat.com>1993-01-29 22:13:36 +0000
commitc4e5d591e07d57d7433400a59cca18e0ce5846e2 (patch)
tree2600107342c075f32bab2096570fd40dafb081f6 /src/xmenu.c
parent5e43ddf5ffd1313c66df0955caa6f9130ed975ec (diff)
downloademacs-c4e5d591e07d57d7433400a59cca18e0ce5846e2.tar.gz
* xmenu.c (Fx_popup_menu): Don't forget to turn the frame-relative
coordinates for the menu position into root-window-relative coordinates.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 70f635ac2f5..e1c14da2f70 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -223,9 +223,31 @@ be the return value for that line (i.e. if it is selected).")
}
#endif
BLOCK_INPUT;
- selection = xmenu_show (ROOT_WINDOW, XMenu_xpos, XMenu_ypos, names, menus,
- items, number_of_panes, obj_list, title,
- &error_name);
+ {
+ Window root;
+ int root_x, root_y;
+ int dummy_int;
+ unsigned int dummy_uint;
+ Window dummy_window;
+
+ /* Figure out which root window F is on. */
+ XGetGeometry (x_current_display, FRAME_X_WINDOW (f), &root,
+ &dummy_int, &dummy_int, &dummy_uint, &dummy_uint,
+ &dummy_uint, &dummy_uint);
+
+ /* Translate the menu co-ordinates within f to menu co-ordinates
+ on that root window. */
+ if (! XTranslateCoordinates (x_current_display,
+ FRAME_X_WINDOW (f), root,
+ XMenu_xpos, XMenu_ypos, &root_x, &root_y,
+ &dummy_window))
+ /* But XGetGeometry said root was the root window of f's screen! */
+ abort ();
+
+ selection = xmenu_show (root, XMenu_xpos, XMenu_ypos, names, menus,
+ items, number_of_panes, obj_list, title,
+ &error_name);
+ }
UNBLOCK_INPUT;
/* fprintf (stderr, "selection = %x\n", selection); */
if (selection != NUL)