comparison src/keyboard.c @ 106738:04c6036b9437

* keyboard.c (read_key_sequence): Catch keyboard switch after making a new tty frame (Bug#5095).
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 05 Jan 2010 07:04:04 -0700
parents 0d1366f2a045
children 65abe959e89a
comparison
equal deleted inserted replaced
106737:6efbdb23aea3 106738:04c6036b9437
9500 KBOARD *interrupted_kboard = current_kboard; 9500 KBOARD *interrupted_kboard = current_kboard;
9501 struct frame *interrupted_frame = SELECTED_FRAME (); 9501 struct frame *interrupted_frame = SELECTED_FRAME ();
9502 key = read_char (NILP (prompt), nmaps, 9502 key = read_char (NILP (prompt), nmaps,
9503 (Lisp_Object *) submaps, last_nonmenu_event, 9503 (Lisp_Object *) submaps, last_nonmenu_event,
9504 &used_mouse_menu, NULL); 9504 &used_mouse_menu, NULL);
9505 if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */ 9505 if ((INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
9506 /* When switching to a new tty (with a new keyboard),
9507 read_char returns the new buffer, rather than -2
9508 (Bug#5095). This is because `terminal-init-xterm'
9509 calls read-char, which eats the wrong_kboard_jmpbuf
9510 return. Any better way to fix this? -- cyd */
9511 || (interrupted_kboard != current_kboard))
9506 { 9512 {
9507 int found = 0; 9513 int found = 0;
9508 struct kboard *k; 9514 struct kboard *k;
9509 9515
9510 for (k = all_kboards; k; k = k->next_kboard) 9516 for (k = all_kboards; k; k = k->next_kboard)