Commit d4068754 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

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


(cherry picked from commit 8e057326)
parent a43496bc
Pipeline #137221 passed with stage
in 15 minutes and 3 seconds
......@@ -1131,8 +1131,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);
}
......@@ -1144,8 +1143,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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment