changeset 44931:18616c930588

Do not grab keyboard if installation-directory is non-nil (not installed Emacs). To simplify debugging.
author Jan Djärv <jan.h.d@swipnet.se>
date Sun, 28 Apr 2002 19:54:01 +0000
parents da2a68646d61
children 19e72b959d90
files lwlib/xlwmenu.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)
         {