]> code.delx.au - gnu-emacs/blobdiff - src/xmenu.c
Merge from origin/emacs-24
[gnu-emacs] / src / xmenu.c
index 9063a8a2a52dc7399479ffe631af0d2c4a0db500..c9f150f67f3e5ca0881144806c9c2bb34720359f 100644 (file)
@@ -1211,13 +1211,25 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
 
   if (use_pos_func)
     {
+      Window dummy_window;
+
       /* Not invoked by a click.  pop up at x/y.  */
       pos_func = menu_position_func;
 
       /* 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 ();
+      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 ();
       popup_x_y.x = x;
       popup_x_y.y = y;
       popup_x_y.f = f;
@@ -2288,7 +2300,7 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
 /* Detect if a dialog or menu has been posted.  MSDOS has its own
    implementation on msdos.c.  */
 
-int ATTRIBUTE_CONST
+int
 popup_activated (void)
 {
   return popup_activated_flag;