mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-04 17:49:45 +02:00
Fix crashes when ESCaping a drag
This commit is contained in:
parent
6c0b3bb1bf
commit
5e4f453a81
@ -753,11 +753,18 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackPanel::Uncapture(wxMouseEvent *pEvent)
|
void TrackPanel::Uncapture(wxMouseState *pState)
|
||||||
{
|
{
|
||||||
|
auto state = ::wxGetMouseState();
|
||||||
|
if (!pState) {
|
||||||
|
// Remap the position
|
||||||
|
state.SetPosition(this->ScreenToClient(state.GetPosition()));
|
||||||
|
pState = &state;
|
||||||
|
}
|
||||||
|
|
||||||
if (HasCapture())
|
if (HasCapture())
|
||||||
ReleaseMouse();
|
ReleaseMouse();
|
||||||
HandleMotion( *pEvent );
|
HandleMotion( *pState );
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackPanel::CancelDragging()
|
void TrackPanel::CancelDragging()
|
||||||
|
@ -313,7 +313,7 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
|
|||||||
// void SetSnapTo(int snapto)
|
// void SetSnapTo(int snapto)
|
||||||
|
|
||||||
void HandleInterruptedDrag();
|
void HandleInterruptedDrag();
|
||||||
void Uncapture( wxMouseEvent *pEvent = nullptr );
|
void Uncapture( wxMouseState *pState = nullptr );
|
||||||
void CancelDragging();
|
void CancelDragging();
|
||||||
bool HandleEscapeKey(bool down);
|
bool HandleEscapeKey(bool down);
|
||||||
void UpdateMouseState(const wxMouseState &state);
|
void UpdateMouseState(const wxMouseState &state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user