From 48c3519390b20d61080957880f56bf8e59e6566d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 30 May 2014 11:10:01 +0200 Subject: [PATCH] [aurorae] Reparent main item to the QQuickWindow This hopefully works around QTBUG-39336. BUG: 335253 REVIEW: 118416 --- clients/aurorae/src/aurorae.cpp | 9 ++++++--- clients/aurorae/src/aurorae.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 7de75850e4..f2d6104c7b 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -251,7 +251,7 @@ AuroraeClient::AuroraeClient(KDecorationBridge *bridge, KDecorationFactory *fact connect(AuroraeFactory::instance(), SIGNAL(buttonsChanged()), SIGNAL(buttonsChanged())); connect(AuroraeFactory::instance(), SIGNAL(configChanged()), SIGNAL(configChanged())); connect(AuroraeFactory::instance(), SIGNAL(titleFontChanged()), SIGNAL(fontChanged())); - connect(m_item.data(), SIGNAL(alphaChanged()), SLOT(slotAlphaChanged())); + connect(m_item, SIGNAL(alphaChanged()), SLOT(slotAlphaChanged())); connect(this, SIGNAL(appMenuAvailable()), SIGNAL(appMenuAvailableChanged())); connect(this, SIGNAL(appMenuUnavailable()), SIGNAL(appMenuAvailableChanged())); } @@ -291,6 +291,7 @@ void AuroraeClient::init() } if (m_item) { m_item->setParentItem(m_view->contentItem()); + m_item->setParent(m_view); } slotAlphaChanged(); @@ -454,13 +455,15 @@ void AuroraeClient::titlePressed(Qt::MouseButton button, Qt::MouseButtons button void AuroraeClient::themeChanged() { - m_item.reset(AuroraeFactory::instance()->createQmlDecoration(this)); + m_item->deleteLater(); + m_item = AuroraeFactory::instance()->createQmlDecoration(this); if (!m_item) { return; } m_item->setParentItem(m_view->contentItem()); - connect(m_item.data(), SIGNAL(alphaChanged()), SLOT(slotAlphaChanged())); + m_item->setParent(m_view); + connect(m_item, SIGNAL(alphaChanged()), SLOT(slotAlphaChanged())); slotAlphaChanged(); } diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index a5d085ce95..646ff3f7e1 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -164,7 +164,7 @@ private Q_SLOTS: private: void sizesFromBorders(const QObject *borders, int &left, int &right, int &top, int &bottom) const; QQuickWindow *m_view; - QScopedPointer m_item; + QQuickItem *m_item; QScopedPointer m_fbo; QImage m_buffer; };