diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp index 0ad1f53bd2..80c4f7514b 100644 --- a/eeschema/sch_draw_panel.cpp +++ b/eeschema/sch_draw_panel.cpp @@ -23,10 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - +#include #include #include +#include #include #include #include @@ -34,8 +35,6 @@ #include #include -#include - #include #include @@ -174,7 +173,19 @@ void SCH_DRAW_PANEL::DisplaySheet( const SCH_SCREEN *aScreen ) void SCH_DRAW_PANEL::OnShow() { - //m_view->RecacheAllItems(); + SCH_BASE_FRAME* frame = dynamic_cast( GetParent() ); + + try + { + // Check if the current rendering backend can be properly initialized + m_view->UpdateItems(); + } + catch( const std::runtime_error& e ) + { + // Fallback to software renderer + DisplayInfoMessage( frame, e.what() ); + SwitchBackend( GAL_TYPE_CAIRO ); + } }