From b49356bc33ad2f094ae0abbce88dfa4de37e73a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 28 Apr 2012 09:39:39 +0200 Subject: [PATCH] Do not perform setupCompositing on Client if Toplevel is not setup Toplevel::setupCompositing returns a boolean value and returns false in the cases where it has not setup compositing. This is used by the specialization on Client to not perform the Client specific setup if Toplevel has not setup. REVIEW: 104767 --- client.h | 2 +- composite.cpp | 14 +++++++++----- toplevel.h | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client.h b/client.h index c34079baa9..dbedc99ef9 100644 --- a/client.h +++ b/client.h @@ -481,7 +481,7 @@ public: void hideClient(bool hide); bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap - virtual void setupCompositing(); + virtual bool setupCompositing(); virtual void finishCompositing(); void setBlockingCompositing(bool block); inline bool isBlockingCompositing() { return blocks_compositing; } diff --git a/composite.cpp b/composite.cpp index 6a27e000be..2ee9e7703c 100644 --- a/composite.cpp +++ b/composite.cpp @@ -520,19 +520,20 @@ void Workspace::delayedCheckUnredirect() // Toplevel //**************************************** -void Toplevel::setupCompositing() +bool Toplevel::setupCompositing() { if (!compositing()) - return; + return false; damageRatio = 0.0; if (damage_handle != None) - return; + return false; damage_handle = XDamageCreate(display(), frameId(), XDamageReportRawRectangles); damage_region = QRegion(0, 0, width(), height()); effect_window = new EffectWindowImpl(this); unredirect = false; workspace()->checkUnredirect(true); scene->windowAdded(this); + return true; } void Toplevel::finishCompositing() @@ -836,12 +837,15 @@ void Toplevel::suspendUnredirect(bool suspend) // Client //**************************************** -void Client::setupCompositing() +bool Client::setupCompositing() { - Toplevel::setupCompositing(); + if (!Toplevel::setupCompositing()){ + return false; + } updateVisibility(); // for internalKeep() updateDecoration(true, true); move(calculateGravitation(true)); // we just polluted the gravity because the window likely has no decoration yet + return true; } void Client::finishCompositing() diff --git a/toplevel.h b/toplevel.h index 95044f3e63..fabb129e74 100644 --- a/toplevel.h +++ b/toplevel.h @@ -227,7 +227,7 @@ public: double opacity() const; int depth() const; bool hasAlpha() const; - virtual void setupCompositing(); + virtual bool setupCompositing(); virtual void finishCompositing(); bool updateUnredirectedState(); bool unredirected() const;