* src/gtkutil.c (xg_widget_key_press_event_cb): Return
immediately if a popup is active.
* src/xterm.c (x_filter_event): Clear `xg_pending_quit_event' if
a popup is active.
if (!f)
return true;
+ if (popup_activated ())
+ return true;
+
#ifdef HAVE_XINPUT2
pending_keystroke_time
= FRAME_DISPLAY_INFO (f)->pending_keystroke_time;
result = xg_filter_key (f1, event);
unblock_input ();
+ /* Clear `xg_pending_quit_event' so we don't end up reacting to quit
+ events sent outside the main event loop (i.e. those sent from
+ inside a popup menu event loop). */
+
+ if (popup_activated ())
+ xg_pending_quit_event.kind = NO_EVENT;
+
if (result && f1)
/* There will probably be a GDK event generated soon, so
exercise the wire to make pselect return. */