From eaec68a0146c8506956f270f34d952425b83dab3 Mon Sep 17 00:00:00 2001 From: James Crook Date: Mon, 15 May 2017 23:17:10 +0100 Subject: [PATCH] Bug 1642 - (Windows) Adding a shortcut or toggling Extra Menus causes ENTER on dropdown to open new project --- src/Project.cpp | 14 +++++++++++++- src/commands/CommandManager.cpp | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Project.cpp b/src/Project.cpp index 181f928bf..48f60ff7c 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -2322,7 +2322,19 @@ bool AudacityProject::TryToMakeActionAllowed void AudacityProject::OnMenu(wxCommandEvent & event) { - +#ifdef __WXMSW__ + // Bug 1642: We can arrive here with bogus menu IDs, which we + // proceed to process. So if bogus, don't. + // The bogus menu IDs are probably generated by controls on the TrackPanel, + // such as the Project Rate. + // 17000 is the magic number at which we start our menu. + // This code would probably NOT be OK on Mac, since we assign + // some specific ID numbers. + if( event.GetId() < 17000){ + event.Skip(); + return; + } +#endif bool handled = mCommandManager.HandleMenuID(event.GetId(), GetUpdateFlags(), NoFlagsSpecifed); diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index 17ba4d187..56eff575d 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -448,7 +448,7 @@ void CommandManager::PurgeData() mCommandIDHash.clear(); mCurrentMenuName = COMMAND; - mCurrentID = 0; + mCurrentID = 17000; }