From 8e05732670b07b82986f1d3e5ff59ad11bc1a4ec Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 14 Feb 2022 10:46:18 +0200 Subject: [PATCH] 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 --- src/x11client.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/x11client.cpp b/src/x11client.cpp index 0f78da2ab3..557ccfb4c2 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -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); }