Mercurial > emacs
comparison src/keyboard.c @ 101139:3ffd03438eeb
(read_char): Fix case where last_nonmenu_event
returned a bad value with submenus. (Bug#447)
author | Martin Rudalics <rudalics@gmx.at> |
---|---|
date | Mon, 12 Jan 2009 09:21:15 +0000 |
parents | 7981035d8c66 |
children | cfaf6934d659 |
comparison
equal
deleted
inserted
replaced
101138:0138ae02cb0d | 101139:3ffd03438eeb |
---|---|
2545 goto reread_first; | 2545 goto reread_first; |
2546 } | 2546 } |
2547 | 2547 |
2548 if (CONSP (Vunread_command_events)) | 2548 if (CONSP (Vunread_command_events)) |
2549 { | 2549 { |
2550 int was_disabled = 0; | |
2551 | |
2550 c = XCAR (Vunread_command_events); | 2552 c = XCAR (Vunread_command_events); |
2551 Vunread_command_events = XCDR (Vunread_command_events); | 2553 Vunread_command_events = XCDR (Vunread_command_events); |
2552 | 2554 |
2553 reread = 1; | 2555 reread = 1; |
2554 | 2556 |
2565 /* Undo what read_char_x_menu_prompt did when it unread | 2567 /* Undo what read_char_x_menu_prompt did when it unread |
2566 additional keys returned by Fx_popup_menu. */ | 2568 additional keys returned by Fx_popup_menu. */ |
2567 if (CONSP (c) | 2569 if (CONSP (c) |
2568 && EQ (XCDR (c), Qdisabled) | 2570 && EQ (XCDR (c), Qdisabled) |
2569 && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c)))) | 2571 && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c)))) |
2570 c = XCAR (c); | 2572 { |
2573 was_disabled = 1; | |
2574 c = XCAR (c); | |
2575 } | |
2571 | 2576 |
2572 /* If the queued event is something that used the mouse, | 2577 /* If the queued event is something that used the mouse, |
2573 set used_mouse_menu accordingly. */ | 2578 set used_mouse_menu accordingly. */ |
2574 if (used_mouse_menu | 2579 if (used_mouse_menu |
2575 && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar))) | 2580 /* Also check was_disabled so last-nonmenu-event won't return |
2581 a bad value when submenus are involved. (Bug#447) */ | |
2582 && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar) || was_disabled)) | |
2576 *used_mouse_menu = 1; | 2583 *used_mouse_menu = 1; |
2577 | 2584 |
2578 goto reread_for_input_method; | 2585 goto reread_for_input_method; |
2579 } | 2586 } |
2580 | 2587 |