aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index e3e6896d0da..de91b40d295 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6586,8 +6586,17 @@ read_avail_input (expected)
6586{ 6586{
6587 register int i; 6587 register int i;
6588 int nread = 0; 6588 int nread = 0;
6589 int err;
6589 struct display *d; 6590 struct display *d;
6590 6591
6592 if (interrupt_input_blocked)
6593 {
6594 interrupt_input_pending = 1;
6595 return -1;
6596 }
6597
6598 BLOCK_INPUT;
6599
6591 /* Loop through the available displays, and call their input hooks. */ 6600 /* Loop through the available displays, and call their input hooks. */
6592 d = display_list; 6601 d = display_list;
6593 while (d) 6602 while (d)
@@ -6625,6 +6634,10 @@ read_avail_input (expected)
6625 discard = 1; 6634 discard = 1;
6626 } 6635 }
6627 } 6636 }
6637 else if (nr == -1) /* Not OK to read input now. */
6638 {
6639 err = 1;
6640 }
6628 else if (nr == -2) /* Non-transient error. */ 6641 else if (nr == -2) /* Non-transient error. */
6629 { 6642 {
6630 /* The display device terminated; it should be closed. */ 6643 /* The display device terminated; it should be closed. */
@@ -6653,6 +6666,11 @@ read_avail_input (expected)
6653 d = next; 6666 d = next;
6654 } 6667 }
6655 6668
6669 if (err && !nread)
6670 nread = -1;
6671
6672 UNBLOCK_INPUT;
6673
6656 return nread; 6674 return nread;
6657} 6675}
6658 6676