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);