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>
bb10
David Edmundson 2017-12-03 10:25:29 +01:00
parent 859a78c0c1
commit 78f234d5dd
1 changed files with 8 additions and 0 deletions

View File

@ -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)