1
0
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:
James Crook 2016-07-17 09:38:23 +01:00
parent e24673fb89
commit d092fe0e4b
4 changed files with 8 additions and 4 deletions

View File

@ -862,6 +862,7 @@ void EffectAutoDuckPanel::OnLeftDown(wxMouseEvent & evt)
for (int i = 0; i < AUTO_DUCK_PANEL_NUM_CONTROL_POINTS; i++)
mMoveStartControlPoints[i] = mControlPoints[i];
if( !HasCapture() )
CaptureMouse();
}
}

View File

@ -168,6 +168,7 @@ void ToolBarResizer::OnLeftDown( wxMouseEvent & event )
mOrigSize = mBar->GetSize();
// We want all of the mouse events
if( !HasCapture() )
CaptureMouse();
}

View File

@ -1358,6 +1358,7 @@ void ToolManager::OnGrabber( GrabberEvent & event )
}
// We want all mouse events from this point on
if( !mParent->HasCapture() )
mParent->CaptureMouse();
// Start monitoring shift key changes

View File

@ -2526,6 +2526,7 @@ void AdornedRulerPanel::HandleQPClick(wxMouseEvent &evt, wxCoord mousePosX)
// Check if we are dragging BEFORE CaptureMouse.
if (mMouseEventState != mesNone)
SetCursor(mCursorSizeWE);
if ( !HasCapture() )
CaptureMouse();
}