D14973: [effects/diminactive] Fix initialization of m_activeWindow on reconfigure

Vlad Zagorodniy <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
zzag created this revision.
zzag added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
zzag requested review of this revision.

REVISION 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(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)

REPOSITORY
  R108 KWin

BRANCH
  effects-diminactive-fix-reconfigure

REVISION DETAIL
  https://phabricator.kde.org/D14973

AFFECTED FILES
  effects/diminactive/diminactive.cpp

To: zzag, #kwin
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.