mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-28 06:08:40 +02:00
Review and fix CaptureMouse (per Bug 1204 commit comment)
This is using the same idiom of only capturing if not capturing already. These cases in AutoDuck, Resizing, Grabber and TQP might have been latent ASSERTs. This based on precedent rather than actual elicited buggy behaviour.
This commit is contained in:
parent
e24673fb89
commit
d092fe0e4b
@ -862,7 +862,8 @@ void EffectAutoDuckPanel::OnLeftDown(wxMouseEvent & evt)
|
|||||||
for (int i = 0; i < AUTO_DUCK_PANEL_NUM_CONTROL_POINTS; i++)
|
for (int i = 0; i < AUTO_DUCK_PANEL_NUM_CONTROL_POINTS; i++)
|
||||||
mMoveStartControlPoints[i] = mControlPoints[i];
|
mMoveStartControlPoints[i] = mControlPoints[i];
|
||||||
|
|
||||||
CaptureMouse();
|
if( !HasCapture() )
|
||||||
|
CaptureMouse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,8 @@ void ToolBarResizer::OnLeftDown( wxMouseEvent & event )
|
|||||||
mOrigSize = mBar->GetSize();
|
mOrigSize = mBar->GetSize();
|
||||||
|
|
||||||
// We want all of the mouse events
|
// We want all of the mouse events
|
||||||
CaptureMouse();
|
if( !HasCapture() )
|
||||||
|
CaptureMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolBarResizer::OnLeftUp( wxMouseEvent & event )
|
void ToolBarResizer::OnLeftUp( wxMouseEvent & event )
|
||||||
|
@ -1358,7 +1358,8 @@ void ToolManager::OnGrabber( GrabberEvent & event )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We want all mouse events from this point on
|
// We want all mouse events from this point on
|
||||||
mParent->CaptureMouse();
|
if( !mParent->HasCapture() )
|
||||||
|
mParent->CaptureMouse();
|
||||||
|
|
||||||
// Start monitoring shift key changes
|
// Start monitoring shift key changes
|
||||||
mLastState = wxGetKeyState( WXK_SHIFT );
|
mLastState = wxGetKeyState( WXK_SHIFT );
|
||||||
|
@ -2526,7 +2526,8 @@ void AdornedRulerPanel::HandleQPClick(wxMouseEvent &evt, wxCoord mousePosX)
|
|||||||
// Check if we are dragging BEFORE CaptureMouse.
|
// Check if we are dragging BEFORE CaptureMouse.
|
||||||
if (mMouseEventState != mesNone)
|
if (mMouseEventState != mesNone)
|
||||||
SetCursor(mCursorSizeWE);
|
SetCursor(mCursorSizeWE);
|
||||||
CaptureMouse();
|
if ( !HasCapture() )
|
||||||
|
CaptureMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdornedRulerPanel::HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX)
|
void AdornedRulerPanel::HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user