Client: Remove some surface commits

The buffer transform, input and opaque regions are double buffered
state. They will be applied on the next surface commit.

But the issue with them is that the relevant code makes surface commits
too. It's undesired as it can lead to qtwayland committing partial
state, for example it can break xdg surface window geometry.

This change removes hidden surface commits. The relevant properties will
be applied on the next frame.

Change-Id: I1c40c9a5430fb6b91d7643b20d628f8a9a9d501a
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Vlad Zahorodnii 2023-08-25 10:15:29 +03:00
parent b3c663d0f8
commit 61f72fc6b6
3 changed files with 2 additions and 7 deletions

View File

@ -395,9 +395,6 @@ bool QWaylandXdgSurface::wantsDecorations() const
void QWaylandXdgSurface::propagateSizeHints()
{
setSizeHints();
if (m_toplevel && m_window)
m_window->commit();
}
void QWaylandXdgSurface::setWindowGeometry(const QRect &rect)

View File

@ -591,8 +591,6 @@ void QWaylandWindow::setMask(const QRegion &mask)
else
setOpaqueArea(mMask);
}
mSurface->commit();
}
void QWaylandWindow::setAlertState(bool enabled)
@ -980,8 +978,6 @@ void QWaylandWindow::handleContentOrientationChange(Qt::ScreenOrientation orient
Q_UNREACHABLE();
}
mSurface->set_buffer_transform(transform);
// set_buffer_transform is double buffered, we need to commit.
mSurface->commit();
}
void QWaylandWindow::setOrientationMask(Qt::ScreenOrientations mask)

View File

@ -615,6 +615,8 @@ void tst_xdgshell::minMaxSize()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
exec([&] { xdgToplevel()->sendCompleteConfigure(); });
// we don't roundtrip with our configuration the initial commit should be correct
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(100, 100));