[aurorae] QQuickWindow needs to be a QPointer instead of a ScopedPointer
Lifetime is bound to the foreign QWindow of the decoration. Thus if that gets destroyed our pointer becomes invalid and we need to track that.
This commit is contained in:
parent
5c3cd6f4bc
commit
16afb24426
2 changed files with 4 additions and 4 deletions
|
@ -266,7 +266,7 @@ void Decoration::init()
|
|||
} else {
|
||||
// we need a QQuickWindow till we depend on Qt 5.4
|
||||
m_decorationWindow.reset(QWindow::fromWinId(client()->decorationId()));
|
||||
m_view.reset(new QQuickWindow(m_decorationWindow.data()));
|
||||
m_view = new QQuickWindow(m_decorationWindow.data());
|
||||
m_view->setFlags(Qt::WindowDoesNotAcceptFocus | Qt::WindowTransparentForInput);
|
||||
m_view->setColor(Qt::transparent);
|
||||
connect(m_view.data(), &QQuickWindow::beforeRendering, [this]() {
|
||||
|
@ -318,8 +318,8 @@ void Decoration::init()
|
|||
m_view->lower();
|
||||
m_view->update();
|
||||
};
|
||||
connect(m_item, &QQuickItem::widthChanged, this, resizeWindow);
|
||||
connect(m_item, &QQuickItem::heightChanged, this, resizeWindow);
|
||||
connect(client().data(), &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow);
|
||||
connect(client().data(), &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow);
|
||||
resizeWindow();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ private:
|
|||
QScopedPointer<QOpenGLFramebufferObject> m_fbo;
|
||||
QImage m_buffer;
|
||||
QScopedPointer<QWindow> m_decorationWindow;
|
||||
QScopedPointer<QQuickWindow> m_view;
|
||||
QPointer<QQuickWindow> m_view;
|
||||
QQuickItem *m_item;
|
||||
KWin::Borders *m_borders;
|
||||
KWin::Borders *m_maximizedBorders;
|
||||
|
|
Loading…
Reference in a new issue