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

wayland: Fix wayland windows growing after toggling decorations

After the decoration is destroyed, we need to resize XdgToplevelClient
to ensure that the scheduled configure event will have correct size.

As is, xdg-toplevel configure events are delayed. When it's actually the
time to send a configure event, XdgToplevelClient will compute the
requested client size from the moveResizeGeometry().

If the moveResizeGeometry() still includes window decorations, the
window will get bigger.

BUG: 444119
(cherry picked from commit 09952e1d)
parent 71a5b00d
......@@ -2355,7 +2355,6 @@ void AbstractClient::createDecoration(const QRect &oldGeometry)
}
setDecoration(decoration);
moveResize(QRect(oldGeometry.topLeft(), clientSizeToFrameSize(clientSize())));
updateDecorationInputShape();
Q_EMIT geometryShapeChanged(this, oldGeometry);
}
......@@ -2363,18 +2362,20 @@ void AbstractClient::createDecoration(const QRect &oldGeometry)
void AbstractClient::destroyDecoration()
{
setDecoration(nullptr);
m_decoration.inputRegion = QRegion();
resize(clientSizeToFrameSize(clientSize()));
}
void AbstractClient::setDecoration(KDecoration2::Decoration *decoration)
{
m_decoration.decoration.reset(decoration);
updateDecorationInputShape();
Q_EMIT decorationChanged();
}
void AbstractClient::updateDecorationInputShape()
{
if (!isDecorated()) {
m_decoration.inputRegion = QRegion();
return;
}
......
......@@ -1148,7 +1148,6 @@ void X11Client::createDecoration(const QRect& oldgeom)
move(calculateGravitation(false));
resize(adjustedSize());
updateDecorationInputShape();
maybeCreateX11DecorationRenderer();
Q_EMIT geometryShapeChanged(this, oldgeom);
}
......@@ -1158,7 +1157,7 @@ void X11Client::destroyDecoration()
QRect oldgeom = frameGeometry();
if (isDecorated()) {
QPoint grav = calculateGravitation(true);
AbstractClient::destroyDecoration();
setDecoration(nullptr);
maybeDestroyX11DecorationRenderer();
resize(adjustedSize());
move(grav);
......
Markdown is supported
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