From 5d63b9c05bbe0c6545b3eeea98d95b40f800fb55 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Tue, 22 Jan 2019 22:36:15 +0300 Subject: [PATCH] Fix flickering with Qt 5.12 Summary: Mesa requires XESetWireToEvent xlib callbacks to be called when DRI2 is used. This is done by the GLX integration in the Qt's xcb plugin, but Qt 5.12 initializes the GLX integration only when required, e.g. when a window with OpenGL support is created or when availability of OpenGL is checked. So force initialization of the GLX integration by calling QOpenGLContext::supportsThreadedOpenGL(). https://codereview.qt-project.org/#/c/6557/ https://bugzilla.opensuse.org/show_bug.cgi?id=1120090 Reviewers: #kwin, graesslin Reviewed By: #kwin, graesslin Subscribers: davidedmundson, graesslin, fvogt, filipf, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D18366 --- plugins/platforms/x11/standalone/glxbackend.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/platforms/x11/standalone/glxbackend.cpp b/plugins/platforms/x11/standalone/glxbackend.cpp index a2c570e59..eb2d46414 100644 --- a/plugins/platforms/x11/standalone/glxbackend.cpp +++ b/plugins/platforms/x11/standalone/glxbackend.cpp @@ -115,6 +115,10 @@ GlxBackend::GlxBackend(Display *display) , haveSwapInterval(false) , m_x11Display(display) { + // Force initialization of GLX integration in the Qt's xcb backend + // to make it call XESetWireToEvent callbacks, which is required + // by Mesa when using DRI2. + QOpenGLContext::supportsThreadedOpenGL(); } static bool gs_tripleBufferUndetected = true; -- GitLab