[aurorae] Reparent main item to the QQuickWindow

This hopefully works around QTBUG-39336.

BUG: 335253
REVIEW: 118416
This commit is contained in:
Martin Gräßlin 2014-05-30 11:10:01 +02:00
parent c16472e535
commit 48c3519390
2 changed files with 7 additions and 4 deletions

View file

@ -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();
}

View file

@ -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<QQuickItem> m_item;
QQuickItem *m_item;
QScopedPointer<QOpenGLFramebufferObject> m_fbo;
QImage m_buffer;
};