Path: utzoo!utgpu!watmath!uunet!mcvax!unido!pcsbst!jkh From: jkh@pcsbst.UUCP (jkh) Newsgroups: gnu.emacs Subject: Fixes for xmenu.c in 18.53.1 Message-ID: <783@pcsbst.UUCP> Date: 19 Mar 89 00:47:36 GMT Reply-To: pcsbst!jkh@pcsbst.UUCP (Jordan K. Hubbard) Organization: PCS GmbH, Pfaelzer-Wald-Str. 36, 8000 Muenchen; West-Germany Lines: 116 As I promised, here are the diffs to xmenu.c to make the menu(s) pop up as children of the root window. I really can't see any reason to constrain them to the emacs window's borders (I've never seen any other application's menus behave this way, anyway) so I didn't make it an option. I welcome any feedback on this. I also fixed a bug where, under X11, the variables dispwidth and dispheight were not being initialized. Strangely enough, the code worked fine anyway on our R2000 box but heaved its guts on our 68020. These diffs are relative to 18.53.1, but should probably work on earlier versions as I don't think xmenu.c has changed in awhile.. Jordan Hubbard PCS Computer Systems pyramid!pcsbst!jkh jkh@violet.berkeley.edu ----- cut here ----- *** xmenu.c.orig Sat Mar 18 20:17:40 1989 --- xmenu.c Sun Mar 19 00:41:44 1989 *************** *** 127,138 **** Lisp_Object ltitle, selection; Lisp_Object XEmacsMenu(); int i, j; BLOCK_INPUT_DECLARE (); check_xterm(); #ifdef X11 ! XMenu_xpos = XXfontw * XINT(Fcar(arg)); ! XMenu_ypos = XXfonth * XINT(Fcar(Fcdr (arg))); #else XMenu_xpos = fontinfo->width * XINT(Fcar(arg)); XMenu_ypos = fontinfo->height * XINT(Fcar(Fcdr (arg))); --- 127,143 ---- Lisp_Object ltitle, selection; Lisp_Object XEmacsMenu(); int i, j; + #ifdef X11 + Window root_window, wjunk; + int ijunk; + #endif BLOCK_INPUT_DECLARE (); check_xterm(); #ifdef X11 ! root_window = RootWindow(XXdisplay, DefaultScreen(XXdisplay)); ! XQueryPointer(XXdisplay, root_window, &wjunk, &wjunk, &XMenu_xpos, ! &XMenu_ypos, &ijunk, &ijunk, &ijunk); #else XMenu_xpos = fontinfo->width * XINT(Fcar(arg)); XMenu_ypos = fontinfo->height * XINT(Fcar(Fcdr (arg))); *************** *** 157,163 **** BLOCK_INPUT (); #ifdef X11 XSetErrorHandler(XMenuQuit); ! selection = XEmacsMenu(XXwindow, XMenu_xpos, XMenu_ypos, names, menus, items, number_of_panes, obj_list ,title, &error_name); XSetErrorHandler(handler); #else --- 162,168 ---- BLOCK_INPUT (); #ifdef X11 XSetErrorHandler(XMenuQuit); ! selection = XEmacsMenu(root_window, XMenu_xpos, XMenu_ypos, names, menus, items, number_of_panes, obj_list ,title, &error_name); XSetErrorHandler(handler); #else *************** *** 215,221 **** Lisp_Object entry; /* struct indices *datap, *datap_save; */ char *datap; ! int ulx, uly, width, height; int dispwidth, dispheight; *error = (char *) 0; /* Initialize error pointer to null */ --- 220,226 ---- Lisp_Object entry; /* struct indices *datap, *datap_save; */ char *datap; ! int ulx = 0, uly = 0, width, height; int dispwidth, dispheight; *error = (char *) 0; /* Initialize error pointer to null */ *************** *** 264,271 **** XMenuRecompute(X11ONLY (XXdisplay) GXMenu); #ifdef X11 XXscreen = DefaultScreen(XXdisplay); ! width = DisplayWidth(XXdisplay, XXscreen); ! height = DisplayHeight(XXdisplay, XXscreen); #else dispwidth = DisplayWidth(); dispheight = DisplayHeight(); --- 269,276 ---- XMenuRecompute(X11ONLY (XXdisplay) GXMenu); #ifdef X11 XXscreen = DefaultScreen(XXdisplay); ! dispwidth = DisplayWidth(XXdisplay, XXscreen); ! dispheight = DisplayHeight(XXdisplay, XXscreen); #else dispwidth = DisplayWidth(); dispheight = DisplayHeight(); *************** *** 287,293 **** } if (ulx < 0) startx -= ulx; if (uly < 0) starty -= uly; - XMenuSetFreeze(GXMenu, TRUE); panes = selidx = 0; --- 292,297 ----