From d293fee801be14d07129e561cbe30e8a12376bfb Mon Sep 17 00:00:00 2001 From: Danim <57731531+danielmartina@users.noreply.github.com> Date: Fri, 30 May 2025 19:15:23 +0200 Subject: [PATCH] Set capture_session.MinUpdateInterval for WGC capture Resolves 60 fps lock issue for WGC capture --- src/platform/windows/display_wgc.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/platform/windows/display_wgc.cpp b/src/platform/windows/display_wgc.cpp index 3e81902f..979ae9c1 100644 --- a/src/platform/windows/display_wgc.cpp +++ b/src/platform/windows/display_wgc.cpp @@ -137,6 +137,17 @@ namespace platf::dxgi { } catch (winrt::hresult_error &e) { BOOST_LOG(warning) << "Screen capture may not be fully supported on this device for this release of Windows: failed to disable border around capture area: [0x"sv << util::hex(e.code()).to_string_view() << ']'; } + try { + if (winrt::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Capture.GraphicsCaptureSession", L"MinUpdateInterval")) { + capture_session.MinUpdateInterval(winrt::TimeSpan{ 10000 }); + } + else { + BOOST_LOG(warning) << "Can't set MinUpdateInterval"; + } + } + catch (winrt::hresult_error &e) { + BOOST_LOG(warning) << "Screen capture may not be fully supported on this device for this release of Windows: failed to set MinUpdateInterval: [0x"sv << util::hex(e.code()).to_string_view() << ']'; + } try { capture_session.StartCapture(); } catch (winrt::hresult_error &e) {