diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index 94654e5684..8b39e2bcba 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -64,7 +64,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin SwitchBackend( aGalType ); SetBackgroundStyle( wxBG_STYLE_CUSTOM ); - + // Scrollbars broken in GAL on OSX #ifdef __WXMAC__ ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER ); @@ -153,6 +153,9 @@ void EDA_DRAW_PANEL_GAL::SetFocus() void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) { + // This is required even though dc is not used otherwise. + wxPaintDC dc(this); + m_pendingRefresh = false; if( m_drawing ) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index f8e0ec6e32..0b220b9347 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -40,6 +40,7 @@ #include #include + using namespace KIGFX; #include "bitmap_font_img.c" @@ -52,6 +53,7 @@ wxGLContext* OPENGL_GAL::glContext = NULL; int OPENGL_GAL::instanceCounter = 0; bool OPENGL_GAL::isBitmapFontLoaded = false; + OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener, wxEvtHandler* aPaintListener, const wxString& aName ) : wxGLCanvas( aParent, wxID_ANY, (int*) glAttributes, wxDefaultPosition, wxDefaultSize, @@ -164,7 +166,6 @@ void OPENGL_GAL::BeginDrawing() #endif /* __WXDEBUG__ */ SetCurrent( *glContext ); - clientDC = new wxClientDC( this ); #ifdef RETINA_OPENGL_PATCH const float scaleFactor = GetBackingScaleFactor(); @@ -300,8 +301,6 @@ void OPENGL_GAL::EndDrawing() SwapBuffers(); - delete clientDC; - #ifdef __WXDEBUG__ prof_end( &totalRealTime ); wxLogTrace( "GAL_PROFILE", wxT( "OPENGL_GAL::EndDrawing(): %.1f ms" ), totalRealTime.msecs() ); diff --git a/include/gal/opengl/opengl_gal.h b/include/gal/opengl/opengl_gal.h index 71619a914e..658d171990 100644 --- a/include/gal/opengl/opengl_gal.h +++ b/include/gal/opengl/opengl_gal.h @@ -52,6 +52,7 @@ namespace KIGFX { class SHADER; + /** * @brief Class OpenGL_GAL is the OpenGL implementation of the Graphics Abstraction Layer. * @@ -62,7 +63,6 @@ class SHADER; class OPENGL_GAL : public GAL, public wxGLCanvas { public: - /** * @brief Constructor OPENGL_GAL * @@ -273,7 +273,6 @@ private: static const int CIRCLE_POINTS = 64; ///< The number of points for circle approximation static const int CURVE_POINTS = 32; ///< The number of points for curve approximation - wxClientDC* clientDC; ///< Drawing context static wxGLContext* glContext; ///< OpenGL context of wxWidgets wxEvtHandler* mouseListener; wxEvtHandler* paintListener;