diff --git a/autotests/mock_effectshandler.h b/autotests/mock_effectshandler.h index e8f46ad773..59d8f114e0 100644 --- a/autotests/mock_effectshandler.h +++ b/autotests/mock_effectshandler.h @@ -40,7 +40,6 @@ public: xcb_atom_t announceSupportProperty(const QByteArray &, KWin::Effect *) override { return XCB_ATOM_NONE; } - void buildQuads(KWin::EffectWindow *, KWin::WindowQuadList &) override {} QRect clientArea(KWin::clientAreaOption, const QPoint &, int) const override { return QRect(); } diff --git a/autotests/test_window_paint_data.cpp b/autotests/test_window_paint_data.cpp index 82f06dc258..0feaf14f17 100644 --- a/autotests/test_window_paint_data.cpp +++ b/autotests/test_window_paint_data.cpp @@ -24,7 +24,7 @@ class MockEffectWindow : public EffectWindow Q_OBJECT public: MockEffectWindow(QObject *parent = nullptr); - WindowQuadList buildQuads(bool force = false) const override; + WindowQuadList buildQuads() const override; QVariant data(int role) const override; QRect decorationInnerRect() const override; void deleteProperty(long int atom) const override; @@ -273,9 +273,8 @@ MockEffectWindow::MockEffectWindow(QObject *parent) { } -WindowQuadList MockEffectWindow::buildQuads(bool force) const +WindowQuadList MockEffectWindow::buildQuads() const { - Q_UNUSED(force) return WindowQuadList(); } diff --git a/src/effects.cpp b/src/effects.cpp index aabb21b50a..65ed266644 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -133,8 +133,6 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) new EffectsAdaptor(this); QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.registerObject(QStringLiteral("/Effects"), this); - // init is important, otherwise causes crashes when quads are build before the first painting pass start - m_currentBuildQuadsIterator = m_activeEffects.constEnd(); Workspace *ws = Workspace::self(); VirtualDesktopManager *vds = VirtualDesktopManager::self(); @@ -477,21 +475,6 @@ void EffectsHandlerImpl::drawWindow(EffectWindow* w, int mask, const QRegion &re m_scene->finalDrawWindow(static_cast(w), mask, region, data); } -void EffectsHandlerImpl::buildQuads(EffectWindow* w, WindowQuadList& quadList) -{ - static bool initIterator = true; - if (initIterator) { - m_currentBuildQuadsIterator = m_activeEffects.constBegin(); - initIterator = false; - } - if (m_currentBuildQuadsIterator != m_activeEffects.constEnd()) { - (*m_currentBuildQuadsIterator++)->buildQuads(w, quadList); - --m_currentBuildQuadsIterator; - } - if (m_currentBuildQuadsIterator == m_activeEffects.constBegin()) - initIterator = true; -} - bool EffectsHandlerImpl::hasDecorationShadows() const { return false; @@ -2106,9 +2089,9 @@ EffectWindowList EffectWindowImpl::mainWindows() const return {}; } -WindowQuadList EffectWindowImpl::buildQuads(bool force) const +WindowQuadList EffectWindowImpl::buildQuads() const { - return sceneWindow()->buildQuads(force); + return sceneWindow()->buildQuads(); } void EffectWindowImpl::setData(int role, const QVariant &data) diff --git a/src/effects.h b/src/effects.h index c0ef80613b..5d5443ac8a 100644 --- a/src/effects.h +++ b/src/effects.h @@ -75,8 +75,6 @@ public: void drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) override; - void buildQuads(EffectWindow* w, WindowQuadList& quadList) override; - void activateWindow(EffectWindow* c) override; EffectWindow* activeWindow() const override; void moveWindow(EffectWindow* w, const QPoint& pos, bool snap = false, double snapAdjust = 1.0) override; @@ -349,7 +347,6 @@ private: EffectsIterator m_currentPaintWindowIterator; EffectsIterator m_currentPaintEffectFrameIterator; EffectsIterator m_currentPaintScreenIterator; - EffectsIterator m_currentBuildQuadsIterator; typedef QHash< QByteArray, QList< Effect*> > PropertyEffectMap; PropertyEffectMap m_propertiesForEffects; QHash m_managedProperties; @@ -493,7 +490,7 @@ public: EffectWindow* transientFor() override; EffectWindowList mainWindows() const override; - WindowQuadList buildQuads(bool force = false) const override; + WindowQuadList buildQuads() const override; void minimize() override; void unminimize() override; diff --git a/src/libkwineffects/kwineffects.cpp b/src/libkwineffects/kwineffects.cpp index 856a42339e..6b04a2a2d4 100644 --- a/src/libkwineffects/kwineffects.cpp +++ b/src/libkwineffects/kwineffects.cpp @@ -609,11 +609,6 @@ void Effect::drawWindow(EffectWindow* w, int mask, const QRegion ®ion, Window effects->drawWindow(w, mask, region, data); } -void Effect::buildQuads(EffectWindow* w, WindowQuadList& quadList) -{ - effects->buildQuads(w, quadList); -} - void Effect::setPositionTransformations(WindowPaintData& data, QRect& region, EffectWindow* w, const QRect& r, Qt::AspectRatioMode aspect) { diff --git a/src/libkwineffects/kwineffects.h b/src/libkwineffects/kwineffects.h index 6a7ab51f9c..8f2cf1512f 100644 --- a/src/libkwineffects/kwineffects.h +++ b/src/libkwineffects/kwineffects.h @@ -512,12 +512,6 @@ public: */ virtual void drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data); - /** - * Define new window quads so that they can be transformed by other effects. - * It's up to the effect to keep track of them. - */ - virtual void buildQuads(EffectWindow* w, WindowQuadList& quadList); - virtual void windowInputMouseEvent(QEvent* e); virtual void grabbedKeyboardEvent(QKeyEvent* e); @@ -844,7 +838,6 @@ public: virtual void postPaintWindow(EffectWindow* w) = 0; virtual void paintEffectFrame(EffectFrame* frame, const QRegion ®ion, double opacity, double frameOpacity) = 0; virtual void drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) = 0; - virtual void buildQuads(EffectWindow* w, WindowQuadList& quadList) = 0; virtual QVariant kwinOption(KWinOption kwopt) = 0; /** * Sets the cursor while the mouse is intercepted. @@ -2440,7 +2433,7 @@ public: /** * Returns the unmodified window quad list. Can also be used to force rebuilding. */ - virtual WindowQuadList buildQuads(bool force = false) const = 0; + virtual WindowQuadList buildQuads() const = 0; void setMinimized(bool minimize); virtual void minimize() = 0; diff --git a/src/scene.cpp b/src/scene.cpp index 55c926dc92..839d9e3a50 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -905,7 +905,6 @@ WindowQuadList Scene::Window::buildQuads(bool force) const if (shadowItem() && toplevel->wantsShadowToBeRendered()) { *ret << shadowItem()->shadow()->shadowQuads(); } - effects->buildQuads(toplevel->effectWindow(), *ret); cached_quad_list.reset(ret); return *ret; }