Kill `Deleted` with fire
When a window is closed, kwin is going to create a Deleted
object, copy data from the original window to the deleted object and discard the original window.
Such lifecycle makes code in some places tedious because one has to replace an instance of the live window with the deleted object. It's easy to forget to copy some value from the original window to the deleted one, etc.
After merging AbstractClient and Toplevel, there's an open opportunity to simplify how kwin handles closed windows. Ideally, when a window is closed, it should be enough to make the isDeleted()
and the isClient()
functions return true
and false
, respectively. We may also need to add reference counting in the window class.
The main disadvantage of this proposal is that you could theoretically do something that's not allowed to perform on deleted windows, e.g. resize. However, many places where kwin wants to have managed windows are marked with corresponding checks.