kwin/effects/diminactive
Vlad Zagorodniy defa1061af [effects/diminactive] Fix initialization of m_activeWindow on reconfigure
Summary:
The Dim Inactive effect sees the world a little bit differently.
m_activeWindow is currently active window that can be dimmed later on.
In most cases, it's the same as effects->activeWindow(). In rare cases,
it can be nullptr, even when effects->activeWindow() is not equal to nullptr
(e.g. when active window is a context menu popup).

canDimWindow is a helper that returns true if a given window should be
dimmed, otherwise it returns false. It has one special case: if a given
window is equal to m_activeWindow, return false. I.e. don't dim active
windows.

Currently, if user changes config of this effect, active window becomes
dimmed.

The reason for that is we hit that special case when deciding whether
effects->activeWindow() should be m_activeWindow.

This change addresses that problem by resetting m_activeWindow so we
don't hit that special case.

Test Plan:
* Opened KCM of this effect;
* Changed strength;
* (the KCM window stayed bright after I clicked "Apply" button).

(everything else works as expected)

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14973
2018-08-21 16:01:55 +03:00
..
CMakeLists.txt Use SERVICE_TYPES parameter to kcoreaddons_desktop_to_json() 2015-12-09 23:42:45 +00:00
diminactive.cpp [effects/diminactive] Fix initialization of m_activeWindow on reconfigure 2018-08-21 16:01:55 +03:00
diminactive.h [effects] Rewrite the Dim Inactive effect 2018-08-21 11:50:37 +03:00
diminactive.kcfg [effects] Use arg="true" in the kcfg files 2017-04-15 10:03:34 +02:00
diminactive_config.cpp [effects] Rewrite the Dim Inactive effect 2018-08-21 11:50:37 +03:00
diminactive_config.desktop SVN_SILENT made messages (.desktop file) - always resolve ours 2018-07-23 05:24:40 +02:00
diminactive_config.h [effects] Rewrite the Dim Inactive effect 2018-08-21 11:50:37 +03:00
diminactive_config.ui [effects] Rewrite the Dim Inactive effect 2018-08-21 11:50:37 +03:00
diminactiveconfig.kcfgc Use KConfigXT in DimInactive Effect 2012-09-14 10:39:27 +02:00