From 58471eb3f267dbee728b1c13f87458f2ee509bfa Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 18 Feb 2013 09:45:24 +0100 Subject: [PATCH] GUI render loop did not render on expose, nor clean up properly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I6f9ab43ad6d149295487d9f69ceb0131cd142776 Reviewed-by: Samuel Rødal --- src/quick/scenegraph/qsgrenderloop.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 9117b2c..83e8d3f 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -194,15 +194,24 @@ void QSGGuiThreadRenderLoop::hide(QQuickWindow *window) cd->cleanupNodesOnShutdown(); if (m_windows.size() == 0) { - sg->invalidate(); - delete gl; - gl = 0; + if (!cd->persistentSceneGraph) { + sg->invalidate(); + if (!cd->persistentGLContext) { + delete gl; + gl = 0; + } + } } } void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window) { hide(window); + if (m_windows.size() == 0) { + sg->invalidate(); + delete gl; + gl = 0; + } } void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) @@ -297,7 +306,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) void QSGGuiThreadRenderLoop::exposureChanged(QQuickWindow *window) { if (window->isExposed()) - maybeUpdate(window); + renderWindow(window); } QImage QSGGuiThreadRenderLoop::grab(QQuickWindow *window) -- 2.7.4