diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 47ad930cf68..4d0fa2e28ef 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -333,10 +333,10 @@ bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface) Q_ASSERT(surface->surface()->supportsOpenGL()); - [m_context makeCurrentContext]; - - if (surface->surface()->surfaceClass() == QSurface::Offscreen) + if (surface->surface()->surfaceClass() == QSurface::Offscreen) { + [m_context makeCurrentContext]; return true; + } QWindow *window = static_cast(surface)->window(); if (!setActiveWindow(window)) { @@ -344,6 +344,8 @@ bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface) return false; } + [m_context makeCurrentContext]; + // Disable high-resolution surfaces when using the software renderer, which has the // problem that the system silently falls back to a to using a low-resolution buffer // when a high-resolution buffer is requested. This is not detectable using the NSWindow