From 005e0d57fc82a1f6ca8b207e2d94dc9849e5e71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Sun, 28 Apr 2002 19:54:30 +0000 Subject: Do not grab keyboard if installation-directory is non-nil (not installed Emacs). To simplify debugging. --- lwlib/ChangeLog | 5 +++++ lwlib/xlwmenu.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'lwlib') diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 28626ddc255..3ead711d797 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,8 @@ +2002-04-28 Jan D. + + * xlwmenu.c: Do not grab keyboard if installation-directory is + non-nil (not installed Emacs). To simplify debugging. + 2002-04-28 Pavel Jan,Bm(Bk * Makefile.in: Remove OpenLook file dependencies. diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index 53dc7022857..d98ce469f9f 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -257,8 +257,10 @@ WidgetClass xlwMenuWidgetClass = (WidgetClass) &xlwMenuClassRec; 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 @@ ungrab_all (w, ungrabtime) 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 @@ pop_up_menu (mw, event) mw->menu.cursor_shape, event->time) == Success) { - if (! x_menu_grab_keyboard + if (! GRAB_KEYBOARD || XtGrabKeyboard ((Widget)mw, False, GrabModeAsync, GrabModeAsync, event->time) == Success) { -- cgit v1.2.1