aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorPo Lu2022-06-20 20:56:49 +0800
committerPo Lu2022-06-20 20:59:38 +0800
commit4cc2f820b500ed2f8fad9baa2cf4a057f271a006 (patch)
treec32aa9a1882205d2ab62367ebadb976e9d06df5a /src/process.c
parenta7aeef934be65ed86993181f3ad3b4b074a6afaa (diff)
downloademacs-4cc2f820b500ed2f8fad9baa2cf4a057f271a006.tar.gz
emacs-4cc2f820b500ed2f8fad9baa2cf4a057f271a006.zip
Fix x-selection-timeout if some keyboard input arrives while waiting
* src/process.c (wait_reading_process_output): Don't allow skipping calls to select if detect_input_pending when just waiting for a cell. (bug#46935) * src/xselect.c (x_get_foreign_selection): Add more debugging code.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c
index 0cbac172fe4..8f654961482 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5492,7 +5492,17 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
5492 triggered by processing X events). In the latter case, set 5492 triggered by processing X events). In the latter case, set
5493 nfds to 1 to avoid breaking the loop. */ 5493 nfds to 1 to avoid breaking the loop. */
5494 no_avail = 0; 5494 no_avail = 0;
5495 if ((read_kbd || !NILP (wait_for_cell)) 5495 if ((read_kbd
5496 /* The following code doesn't make any sense for just the
5497 wait_or_cell case, because detect_input_pending returns
5498 whether or not the keyboard buffer isn't empty or there
5499 is mouse movement. Any keyboard input that arrives
5500 while waiting for a cell will cause the select call to
5501 be skipped, and gobble_input to be called even when
5502 there is no input available from the terminal itself.
5503 Skipping the call to select also causes the timeout to
5504 be ignored. (bug#46935) */
5505 /* || !NILP (wait_for_cell) */)
5496 && detect_input_pending ()) 5506 && detect_input_pending ())
5497 { 5507 {
5498 nfds = read_kbd ? 0 : 1; 5508 nfds = read_kbd ? 0 : 1;