Created
September 10, 2012 14:14
-
-
Save balazs/3691144 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp | |
index 4ae7272..767e6d8 100644 | |
--- a/src/quick/items/qquickwindowmanager.cpp | |
+++ b/src/quick/items/qquickwindowmanager.cpp | |
@@ -367,6 +367,15 @@ void QQuickRenderThreadSingleContextWindowManager::initialize() | |
Q_ASSERT(m_rendered_windows.size()); | |
QQuickWindow *win = masterWindow(); | |
+ if (!win) { | |
+ for (QHash<QQuickWindow *, WindowData *>::const_iterator it = m_rendered_windows.constBegin(); | |
+ it != m_rendered_windows.constEnd() && !win; ++it) { | |
+ QQuickWindowPrivate* window = QQuickWindowPrivate::get(it.key()); | |
+ if (window->renderWithoutShowing) | |
+ win = it.key(); | |
+ } | |
+ } | |
+ | |
if (!win) | |
return; | |
@@ -634,10 +643,7 @@ void QQuickRenderThreadSingleContextWindowManager::run() | |
Q_ASSERT(windowData->windowSize.width() > 0 && windowData->windowSize.height() > 0); | |
- if (!windowData->isVisible) | |
- gl->makeCurrent(masterWindow()); | |
- else | |
- gl->makeCurrent(window); | |
+ gl->makeCurrent(window); | |
if (windowData->viewportSize != windowData->windowSize) { | |
#ifdef THREAD_DEBUG | |
@@ -1183,25 +1189,13 @@ void QQuickTrivialWindowManager::windowDestroyed(QQuickWindow *window) | |
void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window) | |
{ | |
- if (!window->isExposed() || !m_windows.contains(window)) | |
+ bool renderWithoutShowing = QQuickWindowPrivate::get(window)->renderWithoutShowing; | |
+ if ((!window->isExposed() && !renderWithoutShowing) || !m_windows.contains(window)) | |
return; | |
WindowData &data = const_cast<WindowData &>(m_windows[window]); | |
- QQuickWindow *masterWindow = 0; | |
- if (!window->isVisible()) { | |
- // Find a "proper surface" to bind... | |
- for (QHash<QQuickWindow *, WindowData>::const_iterator it = m_windows.constBegin(); | |
- it != m_windows.constEnd() && !masterWindow; ++it) { | |
- if (it.key()->isVisible()) | |
- masterWindow = it.key(); | |
- } | |
- } else { | |
- masterWindow = window; | |
- } | |
- | |
- if (!masterWindow) | |
- return; | |
+ QQuickWindow *masterWindow = window; | |
if (!gl) { | |
gl = new QOpenGLContext(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment