client: Update internal geometry before notifying shell surfaces

Some shell surfaces will query sizes on the window directly. In particular Xdg Shell Popup repositioning.

The update is still processed before the expose event, so we have a chance to pause rendering for async geometry changes.

Change-Id: I3961b282dbb450c864e3543ef267ddcd7a9c36d7
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
David Edmundson 2024-07-25 16:50:10 +01:00
parent c82535143a
commit b2161c6bad

View File

@ -431,6 +431,13 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect)
void QWaylandWindow::setGeometry(const QRect &r)
{
auto rect = r;
if (fixedToplevelPositions && !QPlatformWindow::parent() && window()->type() != Qt::Popup
&& window()->type() != Qt::ToolTip) {
rect.moveTo(screen()->geometry().topLeft());
}
setGeometry_helper(rect);
if (mShellSurface) {
if (!mInResizeFromApplyConfigure) {
const QRect frameGeometry = r.marginsAdded(clientSideMargins()).marginsRemoved(windowContentMargins());
@ -441,13 +448,6 @@ void QWaylandWindow::setGeometry(const QRect &r)
}
}
auto rect = r;
if (fixedToplevelPositions && !QPlatformWindow::parent() && window()->type() != Qt::Popup
&& window()->type() != Qt::ToolTip) {
rect.moveTo(screen()->geometry().topLeft());
}
setGeometry_helper(rect);
if (window()->isVisible() && rect.isValid()) {
if (mWindowDecorationEnabled)
mWindowDecoration->update();