This is an overview task.
X11 Windows and Wayland surfaces are represented inside KWinFT in a class hierarchy:
|Typical Wayland surface with xdg-shell integration||Toplevel → AbstractClient → XdgShellClient|
|Typical X11 windows managed by compositor||Toplevel → AbstractClient → X11Client|
|Unmanaged X11 window (e.g. context menu)||Toplevel → Unmanaged|
|Internal client||Toplevel → AbstractClient → InternalClient|
|Deleted toplevel (used for shutdown animation etc)||Toplevel → Deleted|
This dynamic inheritance feels natural to a certain degree with a Qt background but there are the following issues with it:
- AbstractClient is only there to "hoard" common stuff that managed clients use.
- Too many functions and overrides in classes increase complexity.
Somewhat independent to that class hierarchy but still problematic:
- Q_PROPERTY macros in Toplevel and AbstractClient make the files unreadable: needed for scripting, place in wrapper class?
- Subsurfaces "tacked on" in Scene.
- There is a dizzying amount of "geometries": geometry, bufferGeometry, windowGeometry, frameGeometry
- Factor out an internal windowing template library that windows/surfaces can make use of depending on their needs.
- That should allow us to reduce the levels in the class hierarchy.
- Store a single geometry per window/surface and get others through operations in the windowing template library.
- Move Q_PROPERTY macros to a wrapper class for scripting: #91 (closed)
- Maybe get rid of the Unmanaged and Deleted classes, handle these states through function templates.