Skip to content

placement: don't cascade for the sake of windows that are already covered

Natalie Clarius requested to merge nclarius/kwin:placement-cascade-ignore into master

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:

  1. Open a window non-maximized
  2. Open a window and maximize it
  3. 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.

BUG: 466135

Merge request reports

Loading