diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-06-21 12:15:11 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-06-21 12:15:11 +0200 |
commit | 649b43d20cf75e61fab289f99d20e98b035d5a9a (patch) | |
tree | 52e06419868710fae5746784346f4219a151c952 /lwlib | |
parent | 8cf3c3203b07b781ed34627fce0283d2b1b03fd7 (diff) | |
download | emacs-649b43d20cf75e61fab289f99d20e98b035d5a9a.tar.gz |
Make Lucid menus work from the keyboard also when uninstalled
* lwlib/xlwmenu.c (ungrab_all, pop_up_menu): Use it.
* src/keyboard.c (syms_of_keyboard): New variable (bug#46990).
Diffstat (limited to 'lwlib')
-rw-r--r-- | lwlib/xlwmenu.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index ace5141cdbc..f0625982cf7 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -245,11 +245,6 @@ WidgetClass xlwMenuWidgetClass = (WidgetClass) &xlwMenuClassRec; int submenu_destroyed; -/* 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; /* Utilities */ @@ -259,7 +254,8 @@ static void ungrab_all (Widget w, Time ungrabtime) { XtUngrabPointer (w, ungrabtime); - if (GRAB_KEYBOARD) XtUngrabKeyboard (w, ungrabtime); + if (!lucid__menu_grab_keyboard) + XtUngrabKeyboard (w, ungrabtime); } /* Like abort, but remove grabs from widget W before. */ @@ -2721,7 +2717,7 @@ pop_up_menu (XlwMenuWidget mw, XButtonPressedEvent *event) mw->menu.cursor_shape, event->time) == Success) { - if (! GRAB_KEYBOARD + if (!lucid__menu_grab_keyboard || XtGrabKeyboard ((Widget)mw, False, GrabModeAsync, GrabModeAsync, event->time) == Success) { |