Delay decoration repaint to end of event cycle on create

When a Client gets created the ::createDecoration method is invoked
from ::manage which is called before the Client is added to the
ClientList in Workspace. Thus processing the update fails in the
DecorationBridge as it cannot find the Client.

By delaying to the end of the event cycle we can be sure that the
Client is completely managed and that the scheduled repaint doesn't
fail.

This fixes the missing repaint when a Client starts as inactive.
This commit is contained in:
Martin Gräßlin 2014-12-03 08:28:41 +01:00
parent ac664d8455
commit 13dcafab42

View file

@ -514,7 +514,7 @@ void Client::createDecoration(const QRect& oldgeom)
{
m_decoration = Decoration::DecorationBridge::self()->createDecoration(this);
if (m_decoration) {
m_decoration->update();
QMetaObject::invokeMethod(m_decoration, "update", Qt::QueuedConnection);
connect(m_decoration, &KDecoration2::Decoration::shadowChanged, this, &Toplevel::getShadow);
connect(m_decoration, &KDecoration2::Decoration::resizeOnlyBordersChanged, this, &Client::updateInputWindow);
connect(m_decoration, &KDecoration2::Decoration::bordersChanged, this,