]> code.delx.au - gnu-emacs/blobdiff - src/xmenu.c
Don't declare sys_errlist; declare strerror instead.
[gnu-emacs] / src / xmenu.c
index 1f70766426d48e32e72be626028052afee9c14b9..9fcd49f8a85e87f5da855b68d0c674348c05ce4e 100644 (file)
@@ -30,7 +30,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* On 4.3 this loses if it comes after xterm.h.  */
 #include <signal.h>
-#include "config.h"
+#include <config.h>
 #include "lisp.h"
 #include "frame.h"
 #include "window.h"
@@ -168,6 +168,34 @@ With this form of menu, the return value is VALUE from the chosen item.")
        but I don't want to make one now.  */
     CHECK_WINDOW (window, 0);
 
+#ifdef HAVE_X11
+  {
+    Window child;
+    int win_x = 0, win_y = 0;
+
+    /* Find the position of the outside upper-left corner of
+       the inner window, with respect to the outer window.  */
+    if (f->display.x->parent_desc != ROOT_WINDOW)
+      {
+       BLOCK_INPUT;
+       XTranslateCoordinates (x_current_display,
+
+                              /* From-window, to-window.  */
+                              f->display.x->window_desc,
+                              f->display.x->parent_desc,
+
+                              /* From-position, to-position.  */
+                              0, 0, &win_x, &win_y,
+
+                              /* Child of window.  */
+                              &child);
+       UNBLOCK_INPUT;
+       XMenu_xpos += win_x;
+       XMenu_ypos += win_y;
+      }
+  }
+#endif
+
   XMenu_xpos += FONT_WIDTH (f->display.x->font) * XINT (x);
   XMenu_ypos += FONT_HEIGHT (f->display.x->font) * XINT (y);
 
@@ -192,7 +220,7 @@ With this form of menu, the return value is VALUE from the chosen item.")
 
       /* Extract the detailed info to make one pane.  */
       number_of_panes = keymap_panes (&obj_list, &menus, &names, &enables,
-                                     &items, &menu, 1);
+                                     &items, &prefixes, &menu, 1);
       /* The menu title seems to be ignored,
         so put it in the pane title.  */
       if (menus[0] == 0)
@@ -329,6 +357,7 @@ xmenu_show (parent, startx, starty, line_list, enable_list, pane_list,
   int ulx, uly, width, height;
   int dispwidth, dispheight;
 
+  *error = 0;
   if (pane_cnt == 0)
     return 0;