Don't swap buffers before the window is exposed.
authorMorten Johan Sorvig <morten.sorvig@nokia.com>
Fri, 1 Jun 2012 09:24:04 +0000 (11:24 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 1 Jun 2012 11:33:45 +0000 (13:33 +0200)
At app startup there is often a delay between setting
a window visible and the window being exposed by the
window manager.

Add check to canvas->isExposed() before calling
swapbuffers.

Change-Id: I5e588ab334a72c4fe817da44eff4c3dc785d6b1f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/quick/items/qquickwindowmanager.cpp

index 2022d24..3cfa871 100644 (file)
@@ -706,7 +706,7 @@ void QQuickRenderThreadSingleContextWindowManager::run()
             printf("                RenderThread: --- wait for swap...\n");
 #endif
 
-            if (canvasData->isVisible)
+            if (canvasData->isVisible && canvas->isExposed())
                 gl->swapBuffers(canvas);
 
             canvasPrivate->fireFrameSwapped();