D16731: [effects/slidingpopups] Don't crash when sliding virtual desktops

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 you switch virtual desktops while krunner is sliding in, then
  depending on whether your distro strips assert statements away,
  KWin can crash.
  
  The reason why it crashes is the sliding popups effect tries to unref
  deleted windows that it hasn't referenced before (if there is an active
  full screen effect, then popups won't be slided out, which in its turn
  means that we won't reference deleted windows). So, in the end, the
  refcount of those windows can be -1. That triggers an assert statement
  in the destructor of the Deleted class, which checks whether the
  refcount is equal to 0.
  
  Popups are not slided while there is an active full screen effect because
  we don't know what the full screen effect does.
  
  This patch adjusts the sliding popups effect so it stops all active
  animations when user switches virtual desktops or when a full screen
  effect kicks in. We need to do that so the effect won't try to
  unreference windows in postPaintWindow.
  
  Visually, it doesn't look quite nice, but for now that's good enough.
  A proper fix would be more complex: we would need to make sure that
  full screen effects ignore sliding popups (and also maybe docks) and
  perform some input redirection.
  
  BUG: 400170
  FIXED-IN: 5.14.4

TEST PLAN
  I'm not able anymore to reproduce bug 400170.

REPOSITORY
  R108 KWin

BRANCH
  effects-slidingpopups-dont-crash

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

AFFECTED FILES
  effects/slidingpopups/slidingpopups.cpp
  effects/slidingpopups/slidingpopups.h

To: zzag, #kwin
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, ngraham, 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.