gal: Save canvas type unconditionally
The canvas type might change without the frame being notified. If this happens, the user is presented with repeated notifications of OpenGL issues. Howver, switching canvas is not an error and should be presented to the user as an info message to clarify that the system is still working but it has changed how it renders the screen. Fixes: lp:1795240 * https://bugs.launchpad.net/kicad/+bug/1795240
This commit is contained in:
parent
bb7c889551
commit
fe30460aeb
|
@ -230,7 +230,9 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
|||
SwitchBackend( GAL_FALLBACK );
|
||||
}
|
||||
|
||||
DisplayError( m_parent, wxString( err.what() ) );
|
||||
DisplayInfoMessage( m_parent,
|
||||
_( "Could not use OpenGL, falling back to software rendering" ),
|
||||
wxString( err.what() ) );
|
||||
}
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
|
@ -389,9 +391,14 @@ bool EDA_DRAW_PANEL_GAL::SwitchBackend( GAL_TYPE aGalType )
|
|||
catch( std::runtime_error& err )
|
||||
{
|
||||
aGalType = GAL_TYPE_CAIRO;
|
||||
DisplayError( m_parent, wxString( err.what() ) );
|
||||
DisplayInfoMessage( m_parent,
|
||||
_( "Could not use OpenGL, falling back to software rendering" ),
|
||||
wxString( err.what() ) );
|
||||
}
|
||||
//Fallthrough
|
||||
|
||||
new_gal = new KIGFX::CAIRO_GAL( m_options, this, this, this );
|
||||
break;
|
||||
|
||||
case GAL_TYPE_CAIRO:
|
||||
new_gal = new KIGFX::CAIRO_GAL( m_options, this, this, this );
|
||||
break;
|
||||
|
|
|
@ -147,7 +147,6 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
|||
|
||||
m_canvas = NULL;
|
||||
m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||
m_canvasTypeDirty = false;
|
||||
m_galCanvas = NULL;
|
||||
m_galCanvasActive = false;
|
||||
m_actions = NULL;
|
||||
|
@ -228,8 +227,7 @@ EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
|
|||
socket->Destroy();
|
||||
}
|
||||
|
||||
if( m_canvasTypeDirty ) // the canvas type has changed: save the new type
|
||||
saveCanvasTypeSetting( m_canvasType );
|
||||
saveCanvasTypeSetting( m_canvasType );
|
||||
|
||||
delete m_actions;
|
||||
delete m_toolManager;
|
||||
|
@ -1063,7 +1061,6 @@ bool EDA_DRAW_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
|
|||
use_gal &= aCanvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||
UseGalCanvas( use_gal );
|
||||
m_canvasType = use_gal ? aCanvasType : EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||
m_canvasTypeDirty = true;
|
||||
|
||||
return use_gal;
|
||||
}
|
||||
|
|
|
@ -149,7 +149,6 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
|||
|
||||
m_canvas = NULL;
|
||||
m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||
m_canvasTypeDirty = false;
|
||||
m_galCanvas = NULL;
|
||||
m_galCanvasActive = false;
|
||||
m_actions = NULL;
|
||||
|
@ -231,8 +230,7 @@ EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
|
|||
socket->Destroy();
|
||||
}
|
||||
|
||||
if( m_canvasTypeDirty )
|
||||
saveCanvasTypeSetting( m_canvasType );
|
||||
saveCanvasTypeSetting( m_canvasType );
|
||||
|
||||
delete m_actions;
|
||||
delete m_toolManager;
|
||||
|
@ -1316,7 +1314,6 @@ bool EDA_DRAW_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
|
|||
use_gal &= aCanvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||
UseGalCanvas( use_gal );
|
||||
m_canvasType = use_gal ? aCanvasType : EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||
m_canvasTypeDirty = true;
|
||||
|
||||
return use_gal;
|
||||
}
|
||||
|
|
|
@ -141,7 +141,6 @@ void SCH_BASE_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent )
|
|||
return;
|
||||
|
||||
GetGalCanvas()->SwitchBackend( new_type );
|
||||
m_canvasTypeDirty = true; // force saving new canvas type in config
|
||||
m_canvasType = new_type;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,9 +172,6 @@ protected:
|
|||
/// One-shot to avoid a recursive mouse event during hotkey movement
|
||||
bool m_movingCursorWithKeyboard;
|
||||
|
||||
/// Flag indicating that drawing canvas type needs to be saved to config
|
||||
bool m_canvasTypeDirty;
|
||||
|
||||
/// The current canvas type
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType;
|
||||
|
||||
|
|
Loading…
Reference in New Issue