From b08ef547270001051cc8c93b990446944d54a3dc Mon Sep 17 00:00:00 2001 From: Natalie Clarius Date: Fri, 25 Nov 2022 00:25:03 +0100 Subject: [PATCH] placement: apply cascade-if-covering to placement modes: random, centered, zero-cornered, under mouse --- src/placement.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/placement.cpp b/src/placement.cpp index 827f5289a5..d6c2df1789 100644 --- a/src/placement.cpp +++ b/src/placement.cpp @@ -142,6 +142,7 @@ void Placement::placeAtRandom(Window *c, const QRect &area, PlacementPolicy /*ne py = area.y(); } c->move(QPoint(tx, ty)); + cascadeIfCovering(c, area); } static inline bool isIrrelevant(const Window *window, const Window *regarding, VirtualDesktop *desktop) @@ -445,6 +446,7 @@ void Placement::placeCentered(Window *c, const QRectF &area, PlacementPolicy /*n // place the window c->move(QPoint(xp, yp)); + cascadeIfCovering(c, area); } /** @@ -456,6 +458,7 @@ void Placement::placeZeroCornered(Window *c, const QRect &area, PlacementPolicy // get the maximum allowed windows space and desk's origin c->move(area.topLeft()); + cascadeIfCovering(c, area); } void Placement::placeUtility(Window *c, const QRect &area, PlacementPolicy /*next*/) @@ -509,6 +512,7 @@ void Placement::placeUnderMouse(Window *c, const QRect &area, PlacementPolicy /* geom.moveCenter(Cursors::self()->mouse()->pos()); c->move(geom.topLeft().toPoint()); c->keepInArea(area); // make sure it's kept inside workarea + cascadeIfCovering(c, area); } void Placement::placeOnMainWindow(Window *c, const QRect &area, PlacementPolicy nextPlacement)