# HG changeset patch # User Jim Blandy # Date 728345616 0 # Node ID 1463592a64639820852ca37dfdbbf2df04d7cc44 # Parent e31051f17b9d703c8f4e5266e79f0c5233df49fc * xmenu.c (Fx_popup_menu): Don't forget to turn the frame-relative coordinates for the menu position into root-window-relative coordinates. diff -r e31051f17b9d -r 1463592a6463 src/xmenu.c --- a/src/xmenu.c Fri Jan 29 21:32:37 1993 +0000 +++ b/src/xmenu.c Fri Jan 29 22:13:36 1993 +0000 @@ -223,9 +223,31 @@ } #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)