summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsglcontext.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-01-22 12:57:52 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-01-22 17:20:53 +0000
commit730f0df17db53b249b8680a14c40d12107c8e24e (patch)
treec8b9c9313fa1af5873ed2c24d3146be85cc89d58 /src/plugins/platforms/windows/qwindowsglcontext.cpp
parent024daeb08c77b75638843f6b3d5a93129ffcb0eb (diff)
Windows: Set opengl swap interval whenever we make a new window current
Apparently the windows OpenGL implementation associates the swap interval not with the context, but with the window. Fixes: QTBUG-59660 Change-Id: I78c4cc9f8a5815779a7489edfd731a1debb1e590 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsglcontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 851a6c961e..21cb794196 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -1350,10 +1350,10 @@ bool QWindowsGLContext::makeCurrent(QPlatformSurface *surface)
// Set the swap interval
if (m_staticContext->wglSwapInternalExt) {
const int interval = surface->format().swapInterval();
- if (interval >= 0 && m_swapInterval != interval) {
+ if (m_swapInterval != interval)
m_swapInterval = interval;
+ if (interval >= 0)
m_staticContext->wglSwapInternalExt(interval);
- }
}
return success;