diff --git a/composite.cpp b/composite.cpp index db828bf72a..1bfa66b0df 100644 --- a/composite.cpp +++ b/composite.cpp @@ -529,8 +529,7 @@ void Toplevel::setupCompositing() return; damage_handle = XDamageCreate(display(), frameId(), XDamageReportRawRectangles); damage_region = QRegion(0, 0, width(), height()); - effect_window = new EffectWindowImpl(); - effect_window->setWindow(this); + effect_window = new EffectWindowImpl(this); unredirect = false; workspace()->checkUnredirect(true); scene->windowAdded(this); diff --git a/effects.cpp b/effects.cpp index d229f6d502..4bbcdf99d5 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1325,10 +1325,9 @@ void EffectsHandlerImpl::slotHideOutline() // EffectWindowImpl //**************************************** -EffectWindowImpl::EffectWindowImpl() - : QObject(NULL) - , EffectWindow() - , toplevel(NULL) +EffectWindowImpl::EffectWindowImpl(Toplevel *toplevel) + : EffectWindow(toplevel) + , toplevel(toplevel) , sw(NULL) { } @@ -1465,6 +1464,7 @@ void EffectWindowImpl::unrefWindow() void EffectWindowImpl::setWindow(Toplevel* w) { toplevel = w; + setParent(w); } void EffectWindowImpl::setSceneWindow(Scene::Window* w) diff --git a/effects.h b/effects.h index 30be28f354..98db1fc869 100644 --- a/effects.h +++ b/effects.h @@ -224,11 +224,11 @@ private: QList< Effect* >::iterator m_currentBuildQuadsIterator; }; -class EffectWindowImpl : public QObject, public EffectWindow +class EffectWindowImpl : public EffectWindow { Q_OBJECT public: - EffectWindowImpl(); + EffectWindowImpl(Toplevel *toplevel); virtual ~EffectWindowImpl(); virtual void enablePainting(int reason); diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp index 1ad53bce19..9e7e7b1ca0 100644 --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -282,7 +282,8 @@ EffectsHandler* effects = 0; // EffectWindow //**************************************** -EffectWindow::EffectWindow() +EffectWindow::EffectWindow(QObject *parent) + : QObject(parent) { } diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index b7d8184a22..bae9b79de3 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -1067,8 +1067,9 @@ protected: * The purpose is to hide internal data and also to serve as a single * representation for the case when Client/Unmanaged becomes Deleted. **/ -class KWIN_EXPORT EffectWindow +class KWIN_EXPORT EffectWindow : public QObject { + Q_OBJECT public: /** Flags explaining why painting should be disabled */ enum { @@ -1086,7 +1087,7 @@ public: PAINT_DISABLED_BY_ACTIVITY = 1 << 5 }; - EffectWindow(); + EffectWindow(QObject *parent = NULL); virtual ~EffectWindow(); virtual void enablePainting(int reason) = 0;