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
This commit is contained in:
Alexander Volkov 2019-01-22 22:36:15 +03:00
parent 64658c9d37
commit 5d63b9c05b

View file

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