On start without config, start pcbnew in Cairo GAL

Currently, GAL is initialised to NONE (i.e. off). This causes
issues when Legacy canvas is broken (i.e. GTK3).

This changes the default to GAL Cairo, both in PCB_EDIT_FRAME
init, and in the config load.

Now, when the user starts with no config, they are prompted for
a choice: OpenGL or Cairo, and one of them will be set up, with
Cairo as fall back.

Users on platforms that still support legacy can go to it as normal
from the menu, but it will not be the default in any circumstance.

Fixes: lp:1809997
* https://bugs.launchpad.net/kicad/+bug/1809997
This commit is contained in:
John Beard 2019-01-04 14:00:05 +00:00 committed by Wayne Stambaugh
parent 0fa374cce5
commit b743c39ed8
3 changed files with 8 additions and 5 deletions

View File

@ -1085,10 +1085,11 @@ EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting()
} }
// Coerce the value into a GAL type when Legacy is not available // Coerce the value into a GAL type when Legacy is not available
// Default to Cairo, and on the first, user will be prompted for OpenGL
if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
&& !ADVANCED_CFG::GetCfg().AllowLegacyCanvas() ) && !ADVANCED_CFG::GetCfg().AllowLegacyCanvas() )
{ {
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
} }
return canvasType; return canvasType;

View File

@ -1331,10 +1331,11 @@ EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting()
} }
// Coerce the value into a GAL type when Legacy is not available // Coerce the value into a GAL type when Legacy is not available
// Default to Cairo, and on the first, user will be prompted for OpenGL
if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
&& !ADVANCED_CFG::GetCfg().AllowLegacyCanvas() ) && !ADVANCED_CFG::GetCfg().AllowLegacyCanvas() )
{ {
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
} }
return canvasType; return canvasType;

View File

@ -317,7 +317,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
EDA_DRAW_PANEL_GAL* galCanvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), EDA_DRAW_PANEL_GAL* galCanvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ),
m_FrameSize, m_FrameSize,
GetGalDisplayOptions(), GetGalDisplayOptions(),
EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ); EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO );
SetGalCanvas( galCanvas ); SetGalCanvas( galCanvas );
@ -425,9 +425,10 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
GetEventHandler()->ProcessEvent( cairoEvt ); GetEventHandler()->ProcessEvent( cairoEvt );
} }
} }
else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) else
{ {
// If they were on legacy, switch them to Cairo // If they were on legacy, or they've been coerced into GAL
// due to unavailable legacy (GTK3), switch to Cairo
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO ); wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
GetEventHandler()->ProcessEvent( evt ); GetEventHandler()->ProcessEvent( evt );
} }