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
This commit is contained in:
parent
e179fb697d
commit
fb93037ca7
1 changed files with 8 additions and 3 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue