summaryrefslogtreecommitdiff
path: root/src/protocols/core
diff options
context:
space:
mode:
authorUjinT34 <41110182+UjinT34@users.noreply.github.com>2025-12-03 04:30:43 +0300
committerGitHub <noreply@github.com>2025-12-03 01:30:43 +0000
commit3cf0280b11f370c11e6839275e547779a33f4a19 (patch)
treebcb428c72419fc1cee35d2922a434a34517f79ef /src/protocols/core
parent2cadc8ababb56331c110b7584e09fe0f9352672d (diff)
renderer: add quirks:prefer_hdr to fix HDR activation for some clients (#12436)
Diffstat (limited to 'src/protocols/core')
-rw-r--r--src/protocols/core/Compositor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index 541eae92..efdbff50 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -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();