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:
committed by
Paul Licameli
parent
f3574c6238
commit
1faa234b9e
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user