From 106259f6e6b3e896ee2190195747df753ed308c8 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 10 Jul 2020 09:28:03 -0700 Subject: [PATCH] Set DoubleBuffering to reduce flicker This sets double buffering for GTK and MSW to minimize flicker when redrawing window elements. Fixes https://gitlab.com/kicad/code/kicad/issues/4785 --- eeschema/sch_draw_panel.cpp | 2 ++ eeschema/sch_preview_panel.cpp | 2 ++ gerbview/gerbview_draw_panel_gal.cpp | 1 + pcbnew/pcb_draw_panel_gal.cpp | 1 + 4 files changed, 6 insertions(+) diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp index 5991d1278f..69ee6aa1a6 100644 --- a/eeschema/sch_draw_panel.cpp +++ b/eeschema/sch_draw_panel.cpp @@ -197,6 +197,8 @@ void SCH_DRAW_PANEL::OnShow() if( frame ) frame->ActivateGalCanvas(); } + + m_parent->SetDoubleBuffered( true ); } diff --git a/eeschema/sch_preview_panel.cpp b/eeschema/sch_preview_panel.cpp index da6a3e240e..02da8dfbbe 100644 --- a/eeschema/sch_preview_panel.cpp +++ b/eeschema/sch_preview_panel.cpp @@ -87,6 +87,8 @@ SCH_PREVIEW_PANEL::~SCH_PREVIEW_PANEL() void SCH_PREVIEW_PANEL::OnShow() { + m_parent->SetDoubleBuffered( true ); + //m_view->RecacheAllItems(); } diff --git a/gerbview/gerbview_draw_panel_gal.cpp b/gerbview/gerbview_draw_panel_gal.cpp index 28b541c806..59ce9eac36 100644 --- a/gerbview/gerbview_draw_panel_gal.cpp +++ b/gerbview/gerbview_draw_panel_gal.cpp @@ -100,6 +100,7 @@ void GERBVIEW_DRAW_PANEL_GAL::OnShow() if( frame ) { + m_parent->SetDoubleBuffered( true ); SetTopLayer( frame->GetActiveLayer() ); auto& displ_opts = frame->GetDisplayOptions(); static_cast( diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index 077373c719..3ec08a70c2 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -416,6 +416,7 @@ void PCB_DRAW_PANEL_GAL::OnShow() if( frame ) { + m_parent->SetDoubleBuffered( true ); SetTopLayer( frame->GetActiveLayer() ); KIGFX::PAINTER* painter = m_view->GetPainter(); auto settings = static_cast( painter->GetSettings() );