Ensure forward progress on frame callback.

If the BUFFER flag is not set in a commit, it means
the buffer is inherited on the surface.
As this is equivalent to a commit with same buffer,
ensure forward progress is made on frame callbacks.

This behavior also matches Mutter and Weston based on tests.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2023-05-11 14:52:01 +02:00 committed by Joshie
parent a8ffc64f40
commit 072e31d007

View file

@ -144,12 +144,11 @@ void wlserver_xdg_commit(struct wlr_surface *surf, struct wlr_buffer *buf)
}
void xwayland_surface_commit(struct wlr_surface *wlr_surface) {
uint32_t committed = wlr_surface->current.committed;
wlr_surface->current.committed = 0;
if (!(committed & WLR_SURFACE_STATE_BUFFER)) {
return;
}
// Committing without buffer state is valid and commits the same buffer again.
// Mutter and Weston have forward progress on the frame callback in this situation,
// so let the commit go through. It will be duplication-eliminated later.
VulkanWlrTexture_t *tex = (VulkanWlrTexture_t *) wlr_surface_get_texture( wlr_surface );
if ( tex == NULL )