diff options
| author | Po Lu | 2022-05-13 15:30:22 +0800 |
|---|---|---|
| committer | Po Lu | 2022-05-13 15:31:50 +0800 |
| commit | 85ac627ef4096a2d303f1d37c45da05dea1b7781 (patch) | |
| tree | df9ceaa61fe16c332709e11a9db9c47a2bc64b2e /src | |
| parent | 875da1dc3a7bc304e9571aad65f8cbc524aaac5b (diff) | |
| download | emacs-85ac627ef4096a2d303f1d37c45da05dea1b7781.tar.gz emacs-85ac627ef4096a2d303f1d37c45da05dea1b7781.zip | |
Fix extraneous quit events processing GTK native input inside popups
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gtkutil.c | 3 | ||||
| -rw-r--r-- | src/xterm.c | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index a2ab01d02c5..11ccbbd6683 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -6395,6 +6395,9 @@ xg_widget_key_press_event_cb (GtkWidget *widget, GdkEvent *event, | |||
| 6395 | if (!f) | 6395 | if (!f) |
| 6396 | return true; | 6396 | return true; |
| 6397 | 6397 | ||
| 6398 | if (popup_activated ()) | ||
| 6399 | return true; | ||
| 6400 | |||
| 6398 | #ifdef HAVE_XINPUT2 | 6401 | #ifdef HAVE_XINPUT2 |
| 6399 | pending_keystroke_time | 6402 | pending_keystroke_time |
| 6400 | = FRAME_DISPLAY_INFO (f)->pending_keystroke_time; | 6403 | = FRAME_DISPLAY_INFO (f)->pending_keystroke_time; |
diff --git a/src/xterm.c b/src/xterm.c index 7a570de921f..170f65d06f6 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -14014,6 +14014,13 @@ x_filter_event (struct x_display_info *dpyinfo, XEvent *event) | |||
| 14014 | result = xg_filter_key (f1, event); | 14014 | result = xg_filter_key (f1, event); |
| 14015 | unblock_input (); | 14015 | unblock_input (); |
| 14016 | 14016 | ||
| 14017 | /* Clear `xg_pending_quit_event' so we don't end up reacting to quit | ||
| 14018 | events sent outside the main event loop (i.e. those sent from | ||
| 14019 | inside a popup menu event loop). */ | ||
| 14020 | |||
| 14021 | if (popup_activated ()) | ||
| 14022 | xg_pending_quit_event.kind = NO_EVENT; | ||
| 14023 | |||
| 14017 | if (result && f1) | 14024 | if (result && f1) |
| 14018 | /* There will probably be a GDK event generated soon, so | 14025 | /* There will probably be a GDK event generated soon, so |
| 14019 | exercise the wire to make pselect return. */ | 14026 | exercise the wire to make pselect return. */ |