Be better about cleaning up mouse capture.

Fixes: lp:1841996
* https://bugs.launchpad.net/kicad/+bug/1841996
This commit is contained in:
Jeff Young 2019-08-29 23:07:57 +01:00
parent 359cf384de
commit d2cd659471
1 changed files with 6 additions and 0 deletions

View File

@ -508,7 +508,12 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
m_controls->ForceCursorPosition( true, cursorPos ); m_controls->ForceCursorPosition( true, cursorPos );
auto cleanup = [&] () { auto cleanup = [&] () {
m_controls->SetAutoPan( false );
m_controls->CaptureCursor( false );
preview.Clear(); preview.Clear();
m_view->Update( &preview );
delete dimension; delete dimension;
dimension = nullptr; dimension = nullptr;
step = SET_ORIGIN; step = SET_ORIGIN;
@ -678,6 +683,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
m_controls->SetAutoPan( false ); m_controls->SetAutoPan( false );
m_controls->ForceCursorPosition( false ); m_controls->ForceCursorPosition( false );
m_controls->CaptureCursor( false );
m_view->Remove( &preview ); m_view->Remove( &preview );
frame()->SetMsgPanel( board() ); frame()->SetMsgPanel( board() );