From a0bc8283d3fb11c1bccddbfee043aa1afda995ad Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Wed, 3 Jul 2024 16:56:50 +0300 Subject: [PATCH] Show/hide scrollbars earlier to reduce flickering. --- common/draw_panel_gal.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index 538eb21475..f2e092fd70 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -89,6 +89,11 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin { m_PaintEventCounter = std::make_unique( "Draw panel paint events" ); + if( Pgm().GetCommonSettings()->m_Appearance.show_scrollbars ) + ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS ); + else + ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER ); + SetLayoutDirection( wxLayout_LeftToRight ); m_edaFrame = dynamic_cast( m_parent ); @@ -108,15 +113,6 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin SwitchBackend( aGalType ); SetBackgroundStyle( wxBG_STYLE_CUSTOM ); - if( Pgm().GetCommonSettings()->m_Appearance.show_scrollbars ) - { - ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS ); - } - else - { - ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER ); - } - EnableScrolling( false, false ); // otherwise Zoom Auto disables GAL canvas KIPLATFORM::UI::SetOverlayScrolling( this, false ); // Prevent excessive repaint on GTK KIPLATFORM::UI::ImmControl( this, false ); // Ensure our panel can't suck in IME events