Skip to content

Commit

Permalink
Merge pull request #73 from adenexter/jb28600
Browse files Browse the repository at this point in the history
Backport the QQuickWindow::sceneGraphAboutToStop() signal.
  • Loading branch information
sletta committed Jun 25, 2015
2 parents 10c6012 + 9aebec5 commit c534df3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/quick/items/qquickwindow.h
Expand Up @@ -148,6 +148,7 @@ class Q_QUICK_EXPORT QQuickWindow : public QWindow
void beforeSynchronizing();
void beforeRendering();
void afterRendering();
void sceneGraphAboutToStop();
Q_REVISION(1) void closing(QQuickCloseEvent *close);
void colorChanged(const QColor &);
Q_REVISION(1) void activeFocusItemChanged();
Expand Down
1 change: 1 addition & 0 deletions src/quick/items/qquickwindow_p.h
Expand Up @@ -208,6 +208,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickWindowPrivate : public QWindowPrivate
void updateDirtyNode(QQuickItem *);

void fireFrameSwapped() { Q_EMIT q_func()->frameSwapped(); }
void fireAboutToStop() { Q_EMIT q_func()->sceneGraphAboutToStop(); }

QSGRenderContext *context;
QSGRenderer *renderer;
Expand Down
1 change: 1 addition & 0 deletions src/quick/scenegraph/qsgrenderloop.cpp
Expand Up @@ -240,6 +240,7 @@ void QSGGuiThreadRenderLoop::hide(QQuickWindow *window)
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window);
if (gl)
gl->makeCurrent(window);
cd->fireAboutToStop();
cd->cleanupNodesOnShutdown();

if (m_windows.size() == 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/quick/scenegraph/qsgthreadedrenderloop.cpp
Expand Up @@ -351,6 +351,8 @@ bool QSGRenderThread::event(QEvent *e)
mutex.lock();
if (window) {
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- window removed";
gl->makeCurrent(window);
QQuickWindowPrivate::get(window)->fireAboutToStop();
gl->doneCurrent();
window = 0;
}
Expand Down
1 change: 1 addition & 0 deletions src/quick/scenegraph/qsgwindowsrenderloop.cpp
Expand Up @@ -209,6 +209,7 @@ void QSGWindowsRenderLoop::hide(QQuickWindow *window)
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window);
m_gl->makeCurrent(window);
cd->cleanupNodesOnShutdown();
cd->fireAboutToStop();

// If this is the last tracked window, check for persistent SG and GL and
// potentially clean up.
Expand Down

0 comments on commit c534df3

Please sign in to comment.