mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-27 14:09:33 +02:00
Fix bug 1662 (crashing TCP menu commands on Windows) differently...
Previous fix was at commit f9865f39efe46224a1a77c742a789b2cc70f0c54 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:
parent
f3574c6238
commit
1faa234b9e
@ -1689,17 +1689,13 @@ try
|
|||||||
}
|
}
|
||||||
else if (event.ButtonUp()) {
|
else if (event.ButtonUp()) {
|
||||||
// UIHANDLE RELEASE
|
// UIHANDLE RELEASE
|
||||||
auto uiHandle = mUIHandle;
|
|
||||||
// Null mUIHandle out first before calling Release -- because on Windows, we can
|
|
||||||
// come back recursively to this place during handling of the context menu,
|
|
||||||
// because of a capture lost event.
|
|
||||||
unsigned moreFlags = mMouseOverUpdateFlags;
|
unsigned moreFlags = mMouseOverUpdateFlags;
|
||||||
mUIHandle.reset(), ClearTargets();
|
|
||||||
UIHandle::Result refreshResult =
|
UIHandle::Result refreshResult =
|
||||||
uiHandle->Release( tpmEvent, GetProject(), this );
|
mUIHandle->Release( tpmEvent, GetProject(), this );
|
||||||
ProcessUIHandleResult
|
ProcessUIHandleResult
|
||||||
(this, mRuler, pClickedTrack.get(), pTrack.get(),
|
(this, mRuler, pClickedTrack.get(), pTrack.get(),
|
||||||
refreshResult | moreFlags);
|
refreshResult | moreFlags);
|
||||||
|
mUIHandle.reset(), ClearTargets();
|
||||||
mpClickedTrack.reset();
|
mpClickedTrack.reset();
|
||||||
// will also Uncapture() below
|
// will also Uncapture() below
|
||||||
}
|
}
|
||||||
|
@ -152,12 +152,18 @@ MenuButtonHandle::~MenuButtonHandle()
|
|||||||
}
|
}
|
||||||
|
|
||||||
UIHandle::Result MenuButtonHandle::CommitChanges
|
UIHandle::Result MenuButtonHandle::CommitChanges
|
||||||
(const wxMouseEvent &, AudacityProject *, wxWindow *pParent)
|
(const wxMouseEvent &, AudacityProject *pProject, wxWindow *pParent)
|
||||||
{
|
{
|
||||||
|
auto pPanel = pProject->GetTrackPanel();
|
||||||
auto pCell = mpCell.lock();
|
auto pCell = mpCell.lock();
|
||||||
if (!pCell)
|
if (!pCell)
|
||||||
return RefreshCode::Cancelled;
|
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
|
wxString MenuButtonHandle::Tip(const wxMouseState &) const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user