summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaglcontext.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index ba204236ee..8af90b13bf 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -165,6 +165,16 @@ QSurfaceFormat QCocoaGLContext::format() const
return m_format;
}
+void QCocoaGLContext::windowWasHidden()
+{
+ // If the window is hidden, we need to unset the m_currentWindow
+ // variable so that succeeding makeCurrent's will not abort prematurely
+ // because of the optimization in setActiveWindow.
+ // Doing a full doneCurrent here is not preferable, because the GL context
+ // might be rendering in a different thread at this time.
+ m_currentWindow.clear();
+}
+
void QCocoaGLContext::swapBuffers(QPlatformSurface *surface)
{
QWindow *window = static_cast<QCocoaWindow *>(surface)->window();