From 8910894fabe4ce55a6a8ac987befd1c3a799aa20 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 4 Jun 2018 10:41:13 +0200 Subject: [PATCH] Enable the accelerated canvas on the first pcbnew run if requested Fixes: lp:1769143 * https://bugs.launchpad.net/kicad/+bug/1769143 --- pcbnew/pcb_edit_frame.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 133c1c516f..b9f1edd4b0 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -487,30 +487,25 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : auto handler = GetEventHandler(); handler->ProcessEvent( evt ); } - else + else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) { // If they were on legacy, switch them to Cairo - - if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) - { - wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO ); - auto handler = GetEventHandler(); - handler->ProcessEvent( evt ); - } + wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO ); + auto handler = GetEventHandler(); + handler->ProcessEvent( evt ); } } m_firstRunDialogSetting = 1; SaveSettings( config() ); } - - // Canvas may have been updated by the dialog - canvasType = loadCanvasTypeSetting(); - - if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) + else { - if( GetGalCanvas()->SwitchBackend( canvasType ) ) - UseGalCanvas( true ); + if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) + { + if( GetGalCanvas()->SwitchBackend( canvasType ) ) + UseGalCanvas( true ); + } } enableGALSpecificMenus();