x11: Fix shrinking window size after toggling no border multiple times

The first move() in X11Client::createDecoration() will alter the client
size, which will result in the subsequent resize() incorrectly resizing
to a smaller window size.

In order to fix that issue, this change makes X11Client adjust the
frame geometry atomically after creating or destroying window decoration.

BUG: 449988
This commit is contained in:
Vlad Zahorodnii 2022-02-14 10:46:18 +02:00
parent c76855520c
commit 8e05732670

View file

@ -1135,8 +1135,7 @@ void X11Client::createDecoration(const QRect& oldgeom)
}
setDecoration(decoration);
move(calculateGravitation(false));
resize(implicitSize());
moveResize(QRect(calculateGravitation(false), implicitSize()));
maybeCreateX11DecorationRenderer();
Q_EMIT geometryShapeChanged(this, oldgeom);
}
@ -1148,8 +1147,7 @@ void X11Client::destroyDecoration()
QPoint grav = calculateGravitation(true);
setDecoration(nullptr);
maybeDestroyX11DecorationRenderer();
resize(implicitSize());
move(grav);
moveResize(QRect(grav, implicitSize()));
if (!isZombie()) {
Q_EMIT geometryShapeChanged(this, oldgeom);
}