summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp')
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index 0cbbe5389..e58403ad0 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -315,9 +315,7 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis
mSupportNonBlockingSwap = false;
}
if (!mSupportNonBlockingSwap) {
- qWarning(lcQpaWayland) << "Non-blocking swap buffers not supported."
- << "Subsurface rendering can be affected."
- << "It may also cause the event loop to freeze in some situations";
+ qWarning() << "Non-blocking swap buffers not supported. Subsurface rendering can be affected.";
}
updateGLFormat();
@@ -552,10 +550,20 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface)
m_blitter->blit(window);
}
- window->handleUpdate();
- int swapInterval = mSupportNonBlockingSwap ? 0 : m_format.swapInterval();
- eglSwapInterval(m_eglDisplay, swapInterval);
- eglSwapBuffers(m_eglDisplay, eglSurface);
+
+ QWaylandSubSurface *sub = window->subSurfaceWindow();
+ if (sub) {
+ QMutexLocker l(sub->syncMutex());
+
+ int si = (sub->isSync() && mSupportNonBlockingSwap) ? 0 : m_format.swapInterval();
+
+ eglSwapInterval(m_eglDisplay, si);
+ eglSwapBuffers(m_eglDisplay, eglSurface);
+ } else {
+ eglSwapInterval(m_eglDisplay, m_format.swapInterval());
+ eglSwapBuffers(m_eglDisplay, eglSurface);
+ }
+
window->setCanResize(true);
}