+2009-01-12 Martin Rudalics <rudalics@gmx.at>
+
+ * keyboard.c (read_char): Fix case where last_nonmenu_event
+ returned a bad value with submenus. (Bug#447)
+
2009-01-12 Chong Yidong <cyd@stupidchicken.com>
* xfaces.c (Finternal_set_lisp_face_attribute): If setting the
if (CONSP (Vunread_command_events))
{
+ int was_disabled = 0;
+
c = XCAR (Vunread_command_events);
Vunread_command_events = XCDR (Vunread_command_events);
if (CONSP (c)
&& EQ (XCDR (c), Qdisabled)
&& (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c))))
- c = XCAR (c);
+ {
+ was_disabled = 1;
+ c = XCAR (c);
+ }
/* If the queued event is something that used the mouse,
set used_mouse_menu accordingly. */
if (used_mouse_menu
- && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar)))
+ /* Also check was_disabled so last-nonmenu-event won't return
+ a bad value when submenus are involved. (Bug#447) */
+ && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar) || was_disabled))
*used_mouse_menu = 1;
goto reread_for_input_method;