renderer: add quirks:prefer_hdr to fix HDR activation for some clients (#12436)

This commit is contained in:
UjinT34 2025-12-03 04:30:43 +03:00 committed by GitHub
parent 2cadc8abab
commit 3cf0280b11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 40 additions and 0 deletions

View file

@ -557,6 +557,10 @@ void CWLSurfaceResource::commitState(SSurfaceState& state) {
}
SImageDescription CWLSurfaceResource::getPreferredImageDescription() {
static const auto PFORCE_HDR = CConfigValue<Hyprlang::INT>("quirks:prefer_hdr");
if (*PFORCE_HDR == 1 || (*PFORCE_HDR == 2 && m_hlSurface && m_hlSurface->getWindow() && m_hlSurface->getWindow()->m_class == "gamescope"))
return g_pCompositor->getHDRImageDescription();
auto parent = m_self;
if (parent->m_role->role() == SURFACE_ROLE_SUBSURFACE) {
auto subsurface = sc<CSubsurfaceRole*>(parent->m_role.get())->m_subsurface.lock();