From 412afa3dcd5db9ab17a83c972cd86d32737b2c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 10 Jan 2013 10:10:35 +0100 Subject: [PATCH] Remove asserts from Compositor and wrap Toplevel::compositing() around Workspace::compositing() BUG: 312712 FIXED-IN: 4.10 REVIEW: 108321 --- composite.cpp | 3 +-- composite.h | 1 - workspace.h | 10 +++++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/composite.cpp b/composite.cpp index 99eb65dd7..ea540a4ce 100644 --- a/composite.cpp +++ b/composite.cpp @@ -935,8 +935,7 @@ void Toplevel::damageNotifyEvent(XDamageNotifyEvent* e) bool Toplevel::compositing() const { - Compositor *c = Compositor::self(); - return c && c->hasScene(); + return Workspace::self()->compositing(); } void Client::damageNotifyEvent(XDamageNotifyEvent* e) diff --git a/composite.h b/composite.h index 1655ffeed..04ac4d56c 100644 --- a/composite.h +++ b/composite.h @@ -139,7 +139,6 @@ public: * @see createCompositor **/ static Compositor *self() { - Q_ASSERT(s_compositor); return s_compositor; } /** diff --git a/workspace.h b/workspace.h index 708e23333..ff3784221 100644 --- a/workspace.h +++ b/workspace.h @@ -525,6 +525,11 @@ public: return movingClient; } + /** + * @returns Whether we have a Compositor and it is active (Scene created) + **/ + bool compositing() const; + public slots: // Keybindings void slotSwitchDesktopNext(); @@ -745,11 +750,6 @@ private: static NET::WindowType txtToWindowType(const char* txt); static bool sessionInfoWindowTypeMatch(Client* c, SessionInfo* info); - /** - * @returns Whether we have a Compositor and it is active (Scene created) - **/ - bool compositing() const; - Client* active_client; Client* last_active_client; Client* most_recently_raised; // Used ONLY by raiseOrLowerClient()