diff options
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index eaff417f15..29f46aefd6 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -49,6 +49,7 @@ #include <QtCore/QThread> #include <QtGui/private/qguiapplication_p.h> +#include <QtGui/private/qwindow_p.h> #include <QtGui/QScreen> #include <private/qopenglextensions_p.h> @@ -502,7 +503,13 @@ void QOpenGLContext::swapBuffers(QSurface *surface) if (surface->surfaceType() != QSurface::OpenGLSurface) { qWarning() << "QOpenGLContext::swapBuffers() called with non-opengl surface"; return; - } + } + + if (surface->surfaceClass() == QSurface::Window + && !qt_window_private(static_cast<QWindow *>(surface))->receivedExpose) + { + qWarning() << "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined"; + } QPlatformSurface *surfaceHandle = surface->surfaceHandle(); if (!surfaceHandle) |