Index: gtk/gtkmenushell.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenushell.c,v
retrieving revision 1.87
diff -u -p -r1.87 gtkmenushell.c
--- gtk/gtkmenushell.c	28 Dec 2004 05:33:27 -0000	1.87
+++ gtk/gtkmenushell.c	29 Dec 2004 05:51:48 -0000
@@ -619,11 +619,33 @@ gtk_menu_shell_key_press (GtkWidget   *w
 
   if (!menu_shell->active_menu_item && menu_shell->parent_menu_shell)
     return gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent *)event);
-  
   if (gtk_bindings_activate_event (GTK_OBJECT (widget), event))
     return TRUE;
 
-  return gtk_menu_shell_activate_mnemonic (menu_shell, event);
+  /* First try to find a mnemonic in the current menu shell */
+  if (gtk_menu_shell_activate_mnemonic (menu_shell, event))
+    return TRUE;
+
+  /* Then try an open submenu */
+  if (menu_shell->active_menu_item)
+    {
+      menu_shell = GTK_MENU_SHELL (GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu);
+      if (menu_shell && 
+	  GTK_WIDGET_MAPPED (menu_shell) &&
+	  gtk_menu_shell_activate_mnemonic (menu_shell, event))
+	return TRUE;
+    }
+  
+  /* Try parent menu shells */
+  menu_shell = GTK_MENU_SHELL (widget);
+  while (menu_shell->parent_menu_shell)
+    {
+      menu_shell = GTK_MENU_SHELL (menu_shell->parent_menu_shell);
+      if (gtk_menu_shell_activate_mnemonic (menu_shell, event))
+	return TRUE;
+    }
+
+  return FALSE;
 }
 
 static gint
