improve geometry handling on bordersChanged

a) calculateGravitation on the same borders forth and back is idempotent
b) do not checkWorkspacePosition for shaded windows
   may falsely constrain the unshaded geometry into screen bounds

REVIEW: 123882
BUG: 348064
icc-effect-5.14.5
Thomas Lübking 2015-05-23 10:32:32 +02:00
parent 0b9cfffe1a
commit 1eae9f4baf
1 changed files with 6 additions and 3 deletions

View File

@ -411,11 +411,14 @@ void Client::createDecoration(const QRect& oldgeom)
connect(m_decoration, &KDecoration2::Decoration::bordersChanged, this,
[this]() {
GeometryUpdatesBlocker blocker(this);
move(calculateGravitation(true));
move(calculateGravitation(false));
// TODO: this is obviously idempotent
// calculateGravitation(true) would have to operate on the old border sizes
// move(calculateGravitation(true));
// move(calculateGravitation(false));
QRect oldgeom = geometry();
plainResize(sizeForClientSize(clientSize()), ForceGeometrySet);
checkWorkspacePosition(oldgeom);
if (!isShade())
checkWorkspacePosition(oldgeom);
emit geometryShapeChanged(this, oldgeom);
}
);