diff options
author | David Edmundson <davidedmundson@kde.org> | 2017-12-03 10:25:29 +0100 |
---|---|---|
committer | David Edmundson <davidedmundson@kde.org> | 2018-01-07 21:45:05 +0000 |
commit | 78f234d5dd7face13dd88fd777fa27497590b34d (patch) | |
tree | c58702e28695b6ed085c6c112be4ed4842756e42 /src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h | |
parent | 859a78c0c16db262dc4ca824273386dd0f73cf8b (diff) |
Send NET_WM_SYNC on swapBuffers when using EGL
If a user is using EGL on X, we need to reply to sync requests in the
same way that we do in the GLX backend.
Change-Id: I950de284685dc0ead896688c434828ab1b9c673f
Reviewed-by: Aleix Pol
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h')
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h index fe50afa62a..c3ce8d8745 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglcontext.h @@ -59,6 +59,14 @@ public: void swapBuffers(QPlatformSurface *surface) { QEGLPlatformContext::swapBuffers(surface); + 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, an + // event is sent to QXcbConnection. (this is faster than a metacall) + if (platformWindow->needsSync()) + platformWindow->postSyncWindowRequest(); + } } bool makeCurrent(QPlatformSurface *surface) |