From c23b3ac0d8908a2a7bf5c1a073a35212fbe3f1e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 21 Oct 2014 08:03:23 +0200 Subject: [PATCH] Drop usage of DecoratedClient::handle in DecorationBridge::update We can find the Client for the Decoration without needing to go by the handle. --- decorations/decorationbridge.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/decorations/decorationbridge.cpp b/decorations/decorationbridge.cpp index 196a683a31..c5dea83c3a 100644 --- a/decorations/decorationbridge.cpp +++ b/decorations/decorationbridge.cpp @@ -25,6 +25,7 @@ along with this program. If not, see . #include "client.h" #include "composite.h" #include "scene.h" +#include "workspace.h" // KDecoration #include @@ -115,8 +116,10 @@ std::unique_ptr DecorationBridge::setti void DecorationBridge::update(KDecoration2::Decoration *decoration, const QRect &geometry) { // TODO: remove check once all compositors implement it - if (Renderer *renderer = static_cast(decoration->client()->handle())->renderer()) { - renderer->schedule(geometry); + if (Client *c = Workspace::self()->findClient([decoration] (const Client *client) { return client->decoration() == decoration; })) { + if (Renderer *renderer = c->decoratedClient()->renderer()) { + renderer->schedule(geometry); + } } }