From a91934c7b35f4292080b83e4fc022b468bf609ca Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 11 Jun 2019 09:47:47 +0100 Subject: [PATCH] Don't update toolbars on mouse-move events. It produces cursor-lag in some instances, and none of our state changes currently rely on mouse position. Fixes: lp:1831541 * https://bugs.launchpad.net/kicad/+bug/1831541 --- common/tool/tool_manager.cpp | 10 ++++++---- include/tool/tool_manager.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index 6d3966c9e7..ef56e54884 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -301,7 +301,7 @@ void TOOL_MANAGER::RunAction( const TOOL_ACTION& aAction, bool aNow, void* aPara TOOL_STATE* current = m_activeState; processEvent( event ); setActiveState( current ); - UpdateUI(); + UpdateUI( event ); } else { @@ -795,7 +795,7 @@ bool TOOL_MANAGER::ProcessEvent( const TOOL_EVENT& aEvent ) #endif } - UpdateUI(); + UpdateUI( aEvent ); return hotkey_handled; } @@ -970,13 +970,15 @@ bool TOOL_MANAGER::IsToolActive( TOOL_ID aId ) const } -void TOOL_MANAGER::UpdateUI() +void TOOL_MANAGER::UpdateUI( const TOOL_EVENT& aEvent ) { EDA_BASE_FRAME* frame = GetEditFrame(); if( frame ) { frame->UpdateStatusBar(); - frame->SyncToolbars(); + + if( !aEvent.IsMotion() ) + frame->SyncToolbars(); } } diff --git a/include/tool/tool_manager.h b/include/tool/tool_manager.h index 0449c3782e..e18269a288 100644 --- a/include/tool/tool_manager.h +++ b/include/tool/tool_manager.h @@ -327,9 +327,9 @@ public: void RunMainStack( TOOL_BASE* aTool, std::function aFunc ); /** - * Synchronizes toolbars. + * Updates the status bar and synchronizes toolbars. */ - void UpdateUI(); + void UpdateUI( const TOOL_EVENT& aEvent ); /** * Pauses execution of a given tool until one or more events matching aConditions arrives.