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
This commit is contained in:
Vlad Zahorodnii 2021-10-29 14:43:38 +03:00
parent 637d914f9f
commit 09952e1dc7
2 changed files with 4 additions and 4 deletions

View file

@ -2336,7 +2336,6 @@ void AbstractClient::createDecoration(const QRect &oldGeometry)
}
setDecoration(decoration);
moveResize(QRect(oldGeometry.topLeft(), clientSizeToFrameSize(clientSize())));
updateDecorationInputShape();
Q_EMIT geometryShapeChanged(this, oldGeometry);
}
@ -2344,18 +2343,20 @@ void AbstractClient::createDecoration(const QRect &oldGeometry)
void AbstractClient::destroyDecoration()
{
setDecoration(nullptr);
m_decoration.inputRegion = QRegion();
resize(implicitSize());
}
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;
}

View file

@ -1148,7 +1148,6 @@ void X11Client::createDecoration(const QRect& oldgeom)
move(calculateGravitation(false));
resize(implicitSize());
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(implicitSize());
move(grav);