From 9971d8bbf0efbec47a38f6c1e56c7640e8c19c16 Mon Sep 17 00:00:00 2001 From: xXJsonDeruloXx Date: Tue, 13 Oct 2026 14:21:37 -0400 Subject: [PATCH] fix: retain host composition margin for gamescope Wayland planes --- .../patches/0116-wayland-host-draw-margin.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tools/gamescope/patches/0116-wayland-host-draw-margin.patch diff --git a/tools/gamescope/patches/0116-wayland-host-draw-margin.patch b/tools/gamescope/patches/0116-wayland-host-draw-margin.patch new file mode 100644 index 000000000..b47947929 --- /dev/null +++ b/tools/gamescope/patches/0116-wayland-host-draw-margin.patch @@ -0,0 +1,16 @@ +--- a/src/Backends/WaylandBackend.cpp ++++ b/src/Backends/WaylandBackend.cpp +@@ -1183,7 +1183,12 @@ + wl_display_flush( m_pBackend->GetDisplay() ); + + GetVBlankTimer().UpdateWasCompositing( bNeedsFullComposite ); +- GetVBlankTimer().UpdateLastDrawTime( get_time_in_nanos() - g_SteamCompMgrVBlankTime.ulWakeupTime ); ++ // Direct planes still need time for the host compositor to dispatch and draw. ++ // Measuring only our submission lets the offset decay towards the host's ++ // latch deadline, so small dispatch delays make a capped frame miss a refresh. ++ GetVBlankTimer().UpdateLastDrawTime( std::max( ++ get_time_in_nanos() - g_SteamCompMgrVBlankTime.ulWakeupTime, ++ CVBlankTimer::kDefaultVBlankDrawTimeMinCompositing ) ); + + m_pBackend->PollState(); +