summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-01-05 07:04:04 -0700
committerChong Yidong <cyd@stupidchicken.com>2010-01-05 07:04:04 -0700
commit03f77f0a4470c967d6f4351d347ebedd8fb882bb (patch)
tree8fe70cda78fe130ead16af67b9840343049edca1 /src/keyboard.c
parent69db641dfe32c50abb8319e6d1fb095bb143a5af (diff)
downloademacs-03f77f0a4470c967d6f4351d347ebedd8fb882bb.tar.gz
* keyboard.c (read_key_sequence): Catch keyboard switch after
making a new tty frame (Bug#5095).
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 7a137ea0dca..13d13cd3276 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -9502,7 +9502,13 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
key = read_char (NILP (prompt), nmaps,
(Lisp_Object *) submaps, last_nonmenu_event,
&used_mouse_menu, NULL);
- if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
+ if ((INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
+ /* When switching to a new tty (with a new keyboard),
+ read_char returns the new buffer, rather than -2
+ (Bug#5095). This is because `terminal-init-xterm'
+ calls read-char, which eats the wrong_kboard_jmpbuf
+ return. Any better way to fix this? -- cyd */
+ || (interrupted_kboard != current_kboard))
{
int found = 0;
struct kboard *k;