# HG changeset patch # User Jan Dj¸«£rv # Date 1020023641 0 # Node ID 18616c9305885d6d587c509d2a629044922e31b6 # Parent da2a68646d615dd8f54636bcb5b2a9e8c9928e46 Do not grab keyboard if installation-directory is non-nil (not installed Emacs). To simplify debugging. diff -r da2a68646d61 -r 18616c930588 lwlib/xlwmenu.c --- a/lwlib/xlwmenu.c Sun Apr 28 19:03:24 2002 +0000 +++ b/lwlib/xlwmenu.c Sun Apr 28 19:54:01 2002 +0000 @@ -257,8 +257,10 @@ int submenu_destroyed; -/* For debug, set this to 0 to not grab the keyboard on menu popup */ -int x_menu_grab_keyboard = 1; +/* For debug, if installation-directory is non-nil this is not an installed + Emacs. In that case we do not grab the keyboard to make it easier to + debug. */ +#define GRAB_KEYBOARD (EQ (Vinstallation_directory, Qnil)) static int next_release_must_exit; @@ -271,7 +273,7 @@ Time ungrabtime; { XtUngrabPointer (w, ungrabtime); - if (x_menu_grab_keyboard) XtUngrabKeyboard (w, ungrabtime); + if (GRAB_KEYBOARD) XtUngrabKeyboard (w, ungrabtime); } /* Like abort, but remove grabs from widget W before. */ @@ -2334,7 +2336,7 @@ mw->menu.cursor_shape, event->time) == Success) { - if (! x_menu_grab_keyboard + if (! GRAB_KEYBOARD || XtGrabKeyboard ((Widget)mw, False, GrabModeAsync, GrabModeAsync, event->time) == Success) {