diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index 59c572e73b..44646ba9c8 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -33,6 +33,7 @@ #endif #include "wx/osx/private.h" +#include "wx/osx/private/available.h" WXGLContext WXGLCreateContext( WXGLPixelFormat pixelFormat, WXGLContext shareContext ) { @@ -199,6 +200,14 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const [m_glContext makeCurrentContext]; + // At least under macOS 10.14.5 we need to do this in order to update the + // context with the new size information after the window is resized. + if ( WX_IS_MACOS_AVAILABLE_FULL(10, 14, 5) ) + { + NSOpenGLView *v = (NSOpenGLView *)win.GetHandle(); + [v setOpenGLContext: m_glContext]; + } + return true; }