diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index c4567c4253..3e25f5f0d2 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -189,6 +189,18 @@ void wxMenu::UpdateAccel( } else if (!pItem->IsSeparator()) { + // + // Recurse upwards: we should only modify m_accels of the top level + // menus, not of the submenus as wxMenuBar doesn't look at them + // (alternative and arguable cleaner solution would be to recurse + // downwards in GetAccelCount() and CopyAccels()) + // + if (GetParent()) + { + GetParent()->UpdateAccel(pItem); + return; + } + // // Find the (new) accel for this item //