From 949bcf87125b2b03ec3af8d62a7f4ffcf857ba36 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 24 Jun 2024 09:58:54 +0100 Subject: [PATCH] client: Drop the concept of a queued buffer before the first expose Added in 46aece51330b6f9b5b4bfd68a5b3b183dc5b1c38 this was part of a guard to handle clients committing before the window was configured. Since then there has been work in ensuring expose events are delivered to the client correctly only when the window is configured. Including e6d55239c454d454978edb7d8b17f6c993e7ba07. Even if a client does manually explicitly flush a paint before the first expose, we should be able to simply discard the buffer. It's part of the contract that a client should redraw contents when it gets an expose event. This is better as any queued buffer cannot be of the right size and it simplifies the code. Pick-to: 6.8 Fixes: QTBUG-126262 Change-Id: Ia4829ca75a55819b5e8ab366baedcdf83dfc14ec Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 13 +------------ src/plugins/platforms/wayland/qwaylandwindow_p.h | 2 -- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 1f9e9991469..1ab9dc33791 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -333,12 +333,6 @@ void QWaylandWindow::reset() mInputRegion = QRegion(); mTransparentInputRegion = false; - if (mQueuedBuffer) { - mQueuedBuffer->setBusy(false); - } - mQueuedBuffer = nullptr; - mQueuedBufferDamage = QRegion(); - mDisplay->handleWindowDestroyed(this); } @@ -763,12 +757,7 @@ void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage) if (isExposed()) { commit(buffer, damage); } else { - if (mQueuedBuffer) { - mQueuedBuffer->setBusy(false); - } - mQueuedBuffer = buffer; - mQueuedBuffer->setBusy(true); - mQueuedBufferDamage = damage; + buffer->setBusy(false); } } diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index c1b736c1e95..5eec5b5d136 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h @@ -327,8 +327,6 @@ protected: ToplevelWindowTilingStates mLastReportedToplevelWindowTilingStates = WindowNoState; QWaylandShmBackingStore *mBackingStore = nullptr; - QWaylandBuffer *mQueuedBuffer = nullptr; - QRegion mQueuedBufferDamage; QMargins mCustomMargins;