Commit 70965e96 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

x11: Introduce an envvar to prevent sync'ing to vblanks

This can be useful if you want to ensure that the buffer swap operation
won't block.

CCBUG: 433094
(cherry picked from commit fb93037c)
parent d3c3d8c2
......@@ -237,10 +237,15 @@ void GlxBackend::init()
supportsSwapEvent = false;
}
if (haveSwapInterval) {
setSwapInterval(1);
static bool syncToVblankDisabled = qEnvironmentVariableIsSet("KWIN_X11_NO_SYNC_TO_VBLANK");
if (!syncToVblankDisabled) {
if (haveSwapInterval) {
setSwapInterval(1);
} else {
qCWarning(KWIN_X11STANDALONE) << "glSwapInterval is unsupported";
}
} else {
qCWarning(KWIN_X11STANDALONE) << "glSwapInterval is unsupported";
setSwapInterval(0); // disable vsync if possible
}
if (glPlatform->isVirtualBox()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment