Cleanup virutal desktops in deleted
Needs ReviewPublic

Authored by davidedmundson on Thu, Nov 29, 10:29 PM.

Details

Reviewers
None
Group Reviewers
KWin
Summary

virtual desktops can be destroyed, active clients update, but deleted
keeps a cache.

Someone needs to do cleanup to avoid dangly pointers.

Test Plan

I couldn't find a case of someone calling desktops mid way through an
animation, so it's only a hypothetical bug.

Diff Detail

Repository
R108 KWin
Branch
origin-master (branched from master)
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 5519
Build 5537: arc lint + arc unit
Restricted Application added a project: KWin. · View Herald TranscriptThu, Nov 29, 10:29 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Thu, Nov 29, 10:29 PM
zzag added a subscriber: zzag.Thu, Nov 29, 10:50 PM

If a deleted client is/was on a single virtual desktop, then it can end up on all desktops. We probably don't want that.

Technically sure, but putting it on any arbitrary desktop is just as bad - the correct thing would be to introduce a whole new concept for a crazy edge case that I don't think can really come up.

Workspace::updateClientVisibilityOnDesktopChange doesn't include deleted. Deleted isn't emitting any signals either - so the only case we could see this be relevant is where we're viewing multiple desktops and polling dekstops.
In theory I think that could include desktop grid and desktop cube, but that would require triggering multiple actions faster than I can manage even on the slowest animation speed.

zzag added a comment.Thu, Nov 29, 11:36 PM

Technically sure, but putting it on any arbitrary desktop is just as bad - the correct thing would be to introduce a whole new concept for a crazy edge case that I don't think can really come up.

Shouldn't we just destroy Deleted in that case? (if m_desktops becomes empty)

I don't want to rip out a window whilst effects are referencing it.
Most happen to connect to windowDeleted and tidy up; but I don't think we can rely on that.