]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix extraneous quit events processing GTK native input inside popups
authorPo Lu <luangruo@yahoo.com>
Fri, 13 May 2022 07:30:22 +0000 (15:30 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 13 May 2022 07:31:50 +0000 (15:31 +0800)
* 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.

src/gtkutil.c
src/xterm.c

index a2ab01d02c5054ee265c981c1b78e1eca61a875a..11ccbbd66837288308f53d6f88a98cadd3044d39 100644 (file)
@@ -6395,6 +6395,9 @@ xg_widget_key_press_event_cb (GtkWidget *widget, GdkEvent *event,
   if (!f)
     return true;
 
+  if (popup_activated ())
+    return true;
+
 #ifdef HAVE_XINPUT2
   pending_keystroke_time
     = FRAME_DISPLAY_INFO (f)->pending_keystroke_time;
index 7a570de921f7e17c9443f99dae07aed13582167e..170f65d06f6e8144e35f814d21e04c3be38321f6 100644 (file)
@@ -14014,6 +14014,13 @@ x_filter_event (struct x_display_info *dpyinfo, XEvent *event)
       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.  */