platforms/wayland: Print a warning message if buffer swap fails

If eglSwapBuffers() fails, frame scheduling will be broken. KWin can't
recover from that, but still, having a log message might be useful for
the debugging purposes.
This commit is contained in:
Vlad Zahorodnii 2020-12-06 00:05:39 +02:00
parent 592633eed7
commit 279aef103e

View file

@ -327,10 +327,14 @@ void EglWaylandBackend::presentOnSurface(EglWaylandOutput *output, const QRegion
if (supportsSwapBuffersWithDamage() && !output->m_damageHistory.isEmpty()) {
QVector<EGLint> rects = regionToRects(output->m_damageHistory.constFirst(), waylandOutput);
eglSwapBuffersWithDamageEXT(eglDisplay(), output->m_eglSurface,
rects.data(), rects.count()/4);
if (!eglSwapBuffersWithDamageEXT(eglDisplay(), output->m_eglSurface,
rects.data(), rects.count() / 4)) {
qCCritical(KWIN_WAYLAND_BACKEND, "eglSwapBuffersWithDamage() failed: %x", eglGetError());
}
} else {
eglSwapBuffers(eglDisplay(), output->m_eglSurface);
if (!eglSwapBuffers(eglDisplay(), output->m_eglSurface)) {
qCCritical(KWIN_WAYLAND_BACKEND, "eglSwapBuffers() failed: %x", eglGetError());
}
}
if (supportsBufferAge()) {