Merge AbstractClient and Toplevel
Currently, we have the Toplevel class and the AbstractClient class. The line between them is very blurry. There were multiple cases when we lifted things from AbstractClient to Toplevel, just to simplify code. It would be great if the two are merged.
Unfortunately, we can't just merge them as there's code such as
auto foo = qobject_cast<AbstractClient *>(toplevel);
if (foo)
foo->doSomething();
The first step would be to replace the qobject_cast<>()
s with the following logic
if (!toplevel->isClient())
return;
auto foo = static_cast<AbstractClient *>(toplevel);
In the second phase, do the actual merge.
Here's a draft strategy (each point can be a separate MR):
- Change the type checks as described above for
AbstractClient
(✅ !2224 (merged)) - Change the type checks also for
Deleted
andUnmanaged
(✅ !2232 (merged)) - Inherit both
Deleted
andUnmanaged
fromAbstractClient
(✅ !2236 (merged)) (implies overriding virtual functions) - Move properties of
Toplevel
intoAbstractClient
and… (✅ !2250 (merged)) - …remove Toplevel class (
✅ !2250 (merged)) - Rename
AbstractClient
toWindow
(✅ !2257 (merged)) - Janitorial taks (
✅ !2284 (merged), !2282 (merged))
Edited by Nils Fenner