mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-06 07:29:07 +02:00
Final fix for bug #40 on Windows
I'm 100% certain I found the cause this time (r13739 was still needed though). There's a design flaw in wxMenuBar::RebuildAccelTable() that will always leave the last accelerator active as they are removed from the menus. For the Edit menu, that will be "Move Cursor -> to Track End" because of the way the submenus are traversed. And because that fella happens to have an unmodified character for an accelerator it can't be used in a label track until another menu is opened and closed. The workaround is to nullify the accelerator table when a menu closes.
This commit is contained in:
parent
f7837eea1b
commit
b78f096826
@ -913,6 +913,19 @@ void CommandManager::HandleMenuClose(wxMenuEvent &evt)
|
|||||||
// Forget about it
|
// Forget about it
|
||||||
mOpenMenu = NULL;
|
mOpenMenu = NULL;
|
||||||
|
|
||||||
|
#if defined(__WXMSW__)
|
||||||
|
// On Windows, the last accelerator entry will remain active due to the way that
|
||||||
|
// wxMenuBar::RebuildAccelTable() functions. Just so happens that if that last
|
||||||
|
// entry is an unmodified character, then that character will not be usable in
|
||||||
|
// a label track until a different menu has been opened...thus replacing that
|
||||||
|
// dangling accelerator entry.
|
||||||
|
//
|
||||||
|
// This should go away (or at least be re-evaluated) when moving to wx3 as they've
|
||||||
|
// completely redesigned the accelerator table handling.
|
||||||
|
wxAcceleratorTable & at = const_cast<wxAcceleratorTable &>(GetActiveProject()->GetMenuBar()->GetAccelTable());
|
||||||
|
at = wxNullAcceleratorTable;
|
||||||
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user