1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Fix bug 1662 (crashing TCP menu commands on Windows) differently...

Previous fix was at commit f9865f39ef

But then that had this strange effect on Mac:  when a menu command such as
rename brought up a modal dialog, then the first click in the dialog would pass
through to the tracks behind it, changing the selection, and only a repeated
click on the OK button would dismiss the dialog.

I don't know exactly why that happened.  This avoids it.
This commit is contained in:
Paul Licameli
2017-07-16 02:52:51 -04:00
committed by Paul Licameli
parent f3574c6238
commit 1faa234b9e
2 changed files with 10 additions and 8 deletions

View File

@@ -152,12 +152,18 @@ MenuButtonHandle::~MenuButtonHandle()
}
UIHandle::Result MenuButtonHandle::CommitChanges
(const wxMouseEvent &, AudacityProject *, wxWindow *pParent)
(const wxMouseEvent &, AudacityProject *pProject, wxWindow *pParent)
{
auto pPanel = pProject->GetTrackPanel();
auto pCell = mpCell.lock();
if (!pCell)
return RefreshCode::Cancelled;
return pCell->DoContextMenu(mRect, pParent, NULL);
auto pTrack =
static_cast<CommonTrackPanelCell*>(pCell.get())->FindTrack();
if (!pTrack)
return RefreshCode::Cancelled;
pPanel->CallAfter( [=]{ pPanel->OnTrackMenu( pTrack.get() ); } );
return RefreshCode::RefreshNone;
}
wxString MenuButtonHandle::Tip(const wxMouseState &) const