From 9fae2f4905d5684f19d79bc2a5f839d9f07d7890 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Sun, 21 Oct 2018 21:04:25 +0300 Subject: [PATCH] [effects/invert] Don't block blur and background contrast effect Summary: Background behind some windows is not blurred because the invert effect sets PAINT_WINDOW_TRANSFORMED. This essentially "turns off" the blur and the background contrast effect unless we set the force roles. Because the invert effect is a "post-processing"(not really) effect we don't have to set that flag. BUG: 279076 BUG: 359583 FIXED-IN: 5.14.3 Test Plan: {F6341916} Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D16358 --- effects/invert/invert.cpp | 13 ------------- effects/invert/invert.h | 9 +++++++-- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/effects/invert/invert.cpp b/effects/invert/invert.cpp index acb527d1c5..58c32ca648 100644 --- a/effects/invert/invert.cpp +++ b/effects/invert/invert.cpp @@ -82,19 +82,6 @@ bool InvertEffect::loadData() return true; } -void InvertEffect::prePaintScreen(ScreenPrePaintData &data, int time) -{ - effects->prePaintScreen(data, time); -} - -void InvertEffect::prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time) -{ - if (m_valid && (m_allWindows != m_windows.contains(w))) { - data.mask |= PAINT_WINDOW_TRANSFORMED; - } - effects->prePaintWindow(w, data, time); -} - void InvertEffect::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) { // Load if we haven't already diff --git a/effects/invert/invert.h b/effects/invert/invert.h index 1f946f6c45..65d2e8d1c2 100644 --- a/effects/invert/invert.h +++ b/effects/invert/invert.h @@ -41,12 +41,12 @@ public: ~InvertEffect(); virtual void drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); - virtual void prePaintScreen(ScreenPrePaintData &data, int time); - virtual void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time); virtual void paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity); virtual bool isActive() const; virtual bool provides(Feature); + int requestedEffectChainPosition() const override; + static bool supported(); public Q_SLOTS: @@ -65,6 +65,11 @@ private: QList m_windows; }; +inline int InvertEffect::requestedEffectChainPosition() const +{ + return 99; +} + } // namespace #endif