[effects/diminactive] Fix initialization of m_activeWindow on reconfigure
ClosedPublic

Authored by zzag on Aug 21 2018, 12:48 PM.

Details

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)

Diff Detail

Repository
R108 KWin
Branch
effects-diminactive-fix-reconfigure
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2076
Build 2094: arc lint + arc unit
zzag created this revision.Aug 21 2018, 12:48 PM
Restricted Application added a project: KWin. · View Herald TranscriptAug 21 2018, 12:48 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Aug 21 2018, 12:48 PM
zzag edited the summary of this revision. (Show Details)Aug 21 2018, 12:50 PM
zzag edited the summary of this revision. (Show Details)Aug 21 2018, 12:53 PM
zzag updated this revision to Diff 40146.Aug 21 2018, 12:55 PM

Edit comment

davidedmundson accepted this revision.Aug 21 2018, 12:59 PM
This revision is now accepted and ready to land.Aug 21 2018, 12:59 PM
This revision was automatically updated to reflect the committed changes.