[glxbackend] Introduce env variable KWIN_USE_INTEL_SWAP_EVENT

The feature is pretty much untested as it depends on Qt 5.4 and this
was not a requirement during the development of 5.2. On the other hand
regressions in this feature are very severe as it can freeze the screen
and by that render the system unusable.

This change disables the feature by default. To enable it use the
environment variable KWIN_USE_INTEL_SWAP_EVENT=1.

CCBUG: 342582
REVIEW: 122008
This commit is contained in:
Martin Gräßlin 2015-01-12 08:46:39 +01:00
parent 9fb27bc0ba
commit fcd8cf3ada

View file

@ -183,7 +183,9 @@ void GlxBackend::init()
m_haveMESASwapControl = hasGLExtension(QByteArrayLiteral("GLX_MESA_swap_control"));
m_haveEXTSwapControl = hasGLExtension(QByteArrayLiteral("GLX_EXT_swap_control"));
m_haveSGISwapControl = hasGLExtension(QByteArrayLiteral("GLX_SGI_swap_control"));
m_haveINTELSwapEvent = hasGLExtension(QByteArrayLiteral("GLX_INTEL_swap_event"));
// only enable Intel swap event if env variable is set, see BUG 342582
m_haveINTELSwapEvent = hasGLExtension(QByteArrayLiteral("GLX_INTEL_swap_event"))
&& qgetenv("KWIN_USE_INTEL_SWAP_EVENT") == QByteArrayLiteral("1");
if (m_haveINTELSwapEvent) {
const QList<QByteArray> tokens = QByteArray(qVersion()).split('.');