From 96b75209ab46ba0efc23af8a984f7142c6ba6240 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Samuel=20R=C3=B8dal?= Date: Thu, 19 Apr 2012 10:49:12 +0200 Subject: [PATCH] Delay rendering until canvas is exposed. Prevents warnings about swapBuffers() being called with non-exposed window on xcb. Change-Id: Ib43fd588a7b62e7aaf14f2caddfa498fdced283a Reviewed-by: Gunnar Sletta --- src/quick/items/qquickwindowmanager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp index 45a379a..9b51bf2 100644 --- a/src/quick/items/qquickwindowmanager.cpp +++ b/src/quick/items/qquickwindowmanager.cpp @@ -1167,7 +1167,7 @@ void QQuickTrivialWindowManager::canvasDestroyed(QQuickCanvas *canvas) void QQuickTrivialWindowManager::renderCanvas(QQuickCanvas *canvas) { - if (!m_windows.contains(canvas)) + if (!canvas->isExposed() || !m_windows.contains(canvas)) return; CanvasData &data = const_cast(m_windows[canvas]); @@ -1221,8 +1221,10 @@ void QQuickTrivialWindowManager::renderCanvas(QQuickCanvas *canvas) maybeUpdate(canvas); } -void QQuickTrivialWindowManager::exposureChanged(QQuickCanvas *) +void QQuickTrivialWindowManager::exposureChanged(QQuickCanvas *canvas) { + if (canvas->isExposed()) + renderCanvas(canvas); } QImage QQuickTrivialWindowManager::grab(QQuickCanvas *canvas) -- 2.7.4