placement: don't cascade for the sake of windows that are already covered
When checking for overlap with other windows when placing a new window and cascading to avoid complete overlap, ignore those windows that are already covered by other windows further on the top anyway.
Test plan:
- Open a window non-maximized
- Open a window and maximize it
- Open a window non-maximized
Before: Window 3 is cascaded. This is because we try to avoid overlapping window 1, which is pointless as window 1 is already covered up by window 2 anyway.
After: Window 3 is not cascaded.
The computation of the covered area is not entirely accurate as it uses the bounding rect rather than the combined rects of the windows, but okay enough for our use case imo.
Tested on a 5.27-based branch and then cherry-picked onto a master-based branch.