mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
schematic editor: remove 10ms OnShow timer to reduce CPU load
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20385
This commit is contained in:
parent
19d1b6ec52
commit
a648fccbb3
@ -160,11 +160,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
|
|||||||
Connect( m_refreshTimer.GetId(), wxEVT_TIMER,
|
Connect( m_refreshTimer.GetId(), wxEVT_TIMER,
|
||||||
wxTimerEventHandler( EDA_DRAW_PANEL_GAL::onRefreshTimer ), nullptr, this );
|
wxTimerEventHandler( EDA_DRAW_PANEL_GAL::onRefreshTimer ), nullptr, this );
|
||||||
|
|
||||||
// Set up timer to execute OnShow() method when the window appears on the screen
|
Connect( wxEVT_SHOW, wxShowEventHandler( EDA_DRAW_PANEL_GAL::onShowEvent ), nullptr, this );
|
||||||
m_onShowTimer.SetOwner( this );
|
|
||||||
Connect( m_onShowTimer.GetId(), wxEVT_TIMER,
|
|
||||||
wxTimerEventHandler( EDA_DRAW_PANEL_GAL::onShowTimer ), nullptr, this );
|
|
||||||
m_onShowTimer.Start( 10 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -650,11 +646,10 @@ void EDA_DRAW_PANEL_GAL::onRefreshTimer( wxTimerEvent& aEvent )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EDA_DRAW_PANEL_GAL::onShowTimer( wxTimerEvent& aEvent )
|
void EDA_DRAW_PANEL_GAL::onShowEvent( wxShowEvent& aEvent )
|
||||||
{
|
{
|
||||||
if( m_gal && m_gal->IsInitialized() && m_gal->IsVisible() )
|
if( m_gal && m_gal->IsInitialized() && m_gal->IsVisible() )
|
||||||
{
|
{
|
||||||
m_onShowTimer.Stop();
|
|
||||||
OnShow();
|
OnShow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ protected:
|
|||||||
void onLostFocus( wxFocusEvent& aEvent );
|
void onLostFocus( wxFocusEvent& aEvent );
|
||||||
void onIdle( wxIdleEvent& aEvent );
|
void onIdle( wxIdleEvent& aEvent );
|
||||||
void onRefreshTimer( wxTimerEvent& aEvent );
|
void onRefreshTimer( wxTimerEvent& aEvent );
|
||||||
void onShowTimer( wxTimerEvent& aEvent );
|
void onShowEvent( wxShowEvent& aEvent );
|
||||||
|
|
||||||
wxWindow* m_parent; ///< Pointer to the parent window
|
wxWindow* m_parent; ///< Pointer to the parent window
|
||||||
EDA_DRAW_FRAME* m_edaFrame; ///< Parent EDA_DRAW_FRAME (if available)
|
EDA_DRAW_FRAME* m_edaFrame; ///< Parent EDA_DRAW_FRAME (if available)
|
||||||
@ -288,9 +288,6 @@ protected:
|
|||||||
/// True when canvas needs to be refreshed from idle handler
|
/// True when canvas needs to be refreshed from idle handler
|
||||||
bool m_needIdleRefresh;
|
bool m_needIdleRefresh;
|
||||||
|
|
||||||
/// Timer used to execute OnShow() when the window finally appears on the screen.
|
|
||||||
wxTimer m_onShowTimer;
|
|
||||||
|
|
||||||
/// Interface for drawing objects on a 2D-surface
|
/// Interface for drawing objects on a 2D-surface
|
||||||
KIGFX::GAL* m_gal;
|
KIGFX::GAL* m_gal;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user