Commit 279aef10 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

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.
parent 592633ee
......@@ -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.count()/4);
if (!eglSwapBuffersWithDamageEXT(eglDisplay(), output->m_eglSurface,, 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()) {
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