diff options
Diffstat (limited to 'src/plugins/platforms/xcb/qglxintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qglxintegration.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index c18764a4bb..df929c4b61 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -516,6 +516,15 @@ void QGLXContext::swapBuffers(QPlatformSurface *surface) else glxDrawable = static_cast<QXcbWindow *>(surface)->xcb_window(); glXSwapBuffers(DISPLAY_FROM_XCB(m_screen), glxDrawable); + + if (surface->surface()->surfaceClass() == QSurface::Window) { + QXcbWindow *platformWindow = static_cast<QXcbWindow *>(surface); + // OpenGL context might be bound to a non-gui thread + // use QueuedConnection to sync the window from the platformWindow's thread + // as QXcbWindow is no QObject, a wrapper slot in QXcbConnection is used. + if (platformWindow->needsSync()) + QMetaObject::invokeMethod(m_screen->connection(), "syncWindow", Qt::QueuedConnection, Q_ARG(QXcbWindow*, platformWindow)); + } } void (*QGLXContext::getProcAddress(const QByteArray &procName)) () |