From 9b071cc2baf6f296eb316ca3f0e05e0e3478d57a Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 28 Sep 2023 21:19:06 +0100 Subject: [PATCH] wlserver: Handle pending commits for override surfaces --- src/wlserver.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/wlserver.cpp b/src/wlserver.cpp index 483e51e..90d752c 100644 --- a/src/wlserver.cpp +++ b/src/wlserver.cpp @@ -566,6 +566,28 @@ void gamescope_xwayland_server_t::handle_override_window_content( struct wl_clie if ( x11_surface ) wlserver_x11_surface_info_set_wlr( x11_surface, surface, true ); + + if ( x11_surface ) + { + for (auto it = g_PendingCommits.begin(); it != g_PendingCommits.end();) + { + if (it->surf == surface) + { + PendingCommit_t pending = *it; + + // Still have the buffer lock from before... + assert(x11_surface); + assert(x11_surface->xwayland_server); + x11_surface->xwayland_server->wayland_commit( pending.surf, pending.buf ); + + it = g_PendingCommits.erase(it); + } + else + { + it++; + } + } + } } struct wl_client *gamescope_xwayland_server_t::get_client()