From 13dcafab4263f993ce41d9485c6b0887816a5d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 3 Dec 2014 08:28:41 +0100 Subject: [PATCH] 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. --- client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.cpp b/client.cpp index 8022c7eca0..a9826c7f38 100644 --- a/client.cpp +++ b/client.cpp @@ -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,