Use move resize geometry in AbstractClient::applyWindowRules()

Abstract clients tolerate passing the shaded window geometry to
moveResize().

But the main issue with applyWindowRules() is that it uses the current
frame geometry even though it calls moveResize(). It's not a big deal
but it's error prone.

This change ports applyWindowRules() to the move resize geometry, which
makes code more straightforward and ensures that kwin uses right
geometry type with moveResize().
This commit is contained in:
Vlad Zahorodnii 2021-10-15 08:59:39 +03:00
parent 368bbde1ff
commit cc98001d4c

View file

@ -862,10 +862,11 @@ void AbstractClient::applyWindowRules()
// Placement - does need explicit update, just like some others below
// Geometry : setGeometry() doesn't check rules
auto client_rules = rules();
QRect orig_geom = QRect(pos(), implicitSize()); // handle shading
QRect geom = client_rules->checkGeometry(orig_geom);
if (geom != orig_geom)
moveResize(geom);
const QRect oldGeometry = moveResizeGeometry();
const QRect geometry = client_rules->checkGeometry(oldGeometry);
if (geometry != oldGeometry) {
moveResize(geometry);
}
// MinSize, MaxSize handled by Geometry
// IgnoreGeometry
setDesktops(desktops());