D16582: [effects] Don't emit windowActivated for windows that are not ready for painting

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
  If a window is not ready for painting, then EffectsHandler won't emit
  windowAdded signal and it won't setup all required connections to keep
  track of the current state of the window (one of those signals is
  windowClosed) until the window becomes ready for painting.
  
  In some cases, when a dialog is about to show, a window can be created,
  then that window gets destroyed, and then a new one is created, which
  will be shown to user.
  
  The first window won't be ready for painting, so windowAdded and
  windowClosed signal won't be emitted for it, only windowDeleted.
  
  Effects like Dim Inactive rely on the fact that windowClosed signal is
  always followed by windowDeleted (sooner or later). But for windows that
  are not ready for painting that's not the case.
  
  If a client was added, the Workspace class will emit clientActivated signal
  even if the client is not ready for painting. This led to bug 399612.
  
  396f8f558c07e4c8b0d3090ebe5f65fab1d98f5a <https://phabricator.kde.org/R108:396f8f558c07e4c8b0d3090ebe5f65fab1d98f5a> worked around that bug by
  adding extra cleanup stuff in windowDeleted signal.
  
  This patch implements more proper solution. If EffectsHandler receives
  the clientActivated signal, then it should emit windowActivated signal
  only if the active client is ready for painting or when the condition is
  fulfilled and the client is still active.

TEST PLAN
  Tried to reproduce bug 399612.

REPOSITORY
  R108 KWin

BRANCH
  dont-emit-windowactivated-for-windows-that-are-not-ready-for-painting

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

AFFECTED FILES
  effects.cpp
  effects.h
  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.