mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 06:35:57 +01:00
screencopy: clamp the timer to a miminum of 6 milliseconds (#226)
When the timer is less than 6 milliseconds, the screen copy portal would frequently fail to start working.
This commit is contained in:
parent
72907822c1
commit
8f1ee9f964
1 changed files with 1 additions and 1 deletions
|
@ -689,7 +689,7 @@ void CScreencopyPortal::queueNextShareFrame(CScreencopyPortal::SSession* pSessio
|
||||||
Debug::log(TRACE, "[screencopy] set fps {}, frame took {:.2f}ms, ms till next refresh {:.2f}, estimated actual fps: {:.2f}", pSession->sharingData.framerate, FRAMETOOKMS,
|
Debug::log(TRACE, "[screencopy] set fps {}, frame took {:.2f}ms, ms till next refresh {:.2f}, estimated actual fps: {:.2f}", pSession->sharingData.framerate, FRAMETOOKMS,
|
||||||
MSTILNEXTREFRESH, std::clamp(1000.0 / FRAMETOOKMS, 1.0, (double)pSession->sharingData.framerate));
|
MSTILNEXTREFRESH, std::clamp(1000.0 / FRAMETOOKMS, 1.0, (double)pSession->sharingData.framerate));
|
||||||
|
|
||||||
g_pPortalManager->addTimer({std::clamp(MSTILNEXTREFRESH - 1.0 /* safezone */, 1.0, 1000.0), [pSession]() { g_pPortalManager->m_sPortals.screencopy->startFrameCopy(pSession); }});
|
g_pPortalManager->addTimer({std::clamp(MSTILNEXTREFRESH - 1.0 /* safezone */, 6.0, 1000.0), [pSession]() { g_pPortalManager->m_sPortals.screencopy->startFrameCopy(pSession); }});
|
||||||
}
|
}
|
||||||
bool CScreencopyPortal::hasToplevelCapabilities() {
|
bool CScreencopyPortal::hasToplevelCapabilities() {
|
||||||
return m_sState.toplevel;
|
return m_sState.toplevel;
|
||||||
|
|
Loading…
Reference in a new issue