summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-10-22 20:15:22 +0800
committerPo Lu <luangruo@yahoo.com>2022-10-22 20:21:55 +0800
commitf85bdb49923a60d3d0cc3bf66ad884555d92840c (patch)
tree6b8aadbaff5884fcd591a864d5f36f4203502a14
parent636322cfe06daef07d8fe8a7650fbe27370aea22 (diff)
downloademacs-f85bdb49923a60d3d0cc3bf66ad884555d92840c.tar.gz
Further fixes to menu event processing on no-toolkit builds
* src/xdisp.c (note_mouse_highlight): Return if a popup is activated under the no-toolkit build as well. * src/xmenu.c (pop_down_menu): Clear popup_activated_flag when not on MS-DOS. (x_menu_show): Set popup_activated_flag under X.
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xmenu.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index e390de6a336..1f7ac269e4e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -34912,7 +34912,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
struct buffer *b;
/* When a menu is active, don't highlight because this looks odd. */
-#if defined (USE_X_TOOLKIT) || (defined (USE_GTK) && !defined (HAVE_PGTK)) || defined (HAVE_NS) || defined (MSDOS)
+#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) || defined (MSDOS)
if (popup_activated ())
return;
#endif
diff --git a/src/xmenu.c b/src/xmenu.c
index d9660a6910f..756842c2fef 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -2540,6 +2540,8 @@ pop_down_menu (void *arg)
}
#endif
+ /* Decrement the popup_activated_flag. */
+ popup_activated_flag = 0;
#endif /* HAVE_X_WINDOWS */
unblock_input ();
@@ -2791,6 +2793,12 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
}
#endif
+#ifdef HAVE_X_WINDOWS
+ /* Increment the popup flag; this prevents nested popups from being
+ displayed by user Lisp code in help-echo callbacks, and also
+ prevents mouse face from being displayed. */
+ popup_activated_flag = 1;
+#endif
status = XMenuActivate (FRAME_X_DISPLAY (f), menu, &pane, &selidx,
x, y, ButtonReleaseMask, &datap,
menu_help_callback);