summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorUjinT34 <41110182+UjinT34@users.noreply.github.com>2025-04-29 23:09:14 +0300
committerGitHub <noreply@github.com>2025-04-29 22:09:14 +0200
commitae1fe860ff73071cd14803c4495049a8969bb8f9 (patch)
tree1766262bfdd633554636c18abfb84a3424a9c324 /src
parent49974d5e34292ede24351c8638fe060b382bbda0 (diff)
renderer: add render:send_content_type setting (#9851)
Diffstat (limited to 'src')
-rw-r--r--src/config/ConfigDescriptions.hpp6
-rw-r--r--src/config/ConfigManager.cpp1
-rw-r--r--src/render/Renderer.cpp13
3 files changed, 15 insertions, 5 deletions
diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp
index 236f4d6e..39c1b522 100644
--- a/src/config/ConfigDescriptions.hpp
+++ b/src/config/ConfigDescriptions.hpp
@@ -1444,6 +1444,12 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
.type = CONFIG_OPTION_BOOL,
.data = SConfigOptionDescription::SBoolData{true},
},
+ SConfigOptionDescription{
+ .value = "render:send_content_type",
+ .description = "Report content type to allow monitor profile autoswitch (may result in a black screen during the switch)",
+ .type = CONFIG_OPTION_BOOL,
+ .data = SConfigOptionDescription::SBoolData{true},
+ },
/*
* cursor:
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 790e8484..0c45186e 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -739,6 +739,7 @@ CConfigManager::CConfigManager() {
registerConfigVar("render:ctm_animation", Hyprlang::INT{2});
registerConfigVar("render:cm_fs_passthrough", Hyprlang::INT{2});
registerConfigVar("render:cm_enabled", Hyprlang::INT{1});
+ registerConfigVar("render:send_content_type", Hyprlang::INT{1});
registerConfigVar("ecosystem:no_update_news", Hyprlang::INT{0});
registerConfigVar("ecosystem:no_donation_nag", Hyprlang::INT{0});
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 813aec08..0db305af 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1477,6 +1477,7 @@ static hdr_output_metadata createHDRMetadata(SImageDescription settings, A
}
bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
+ static auto PCT = CConfigValue<Hyprlang::INT>("render:send_content_type");
static auto PPASS = CConfigValue<Hyprlang::INT>("render:cm_fs_passthrough");
const bool PHDR = pMonitor->imageDescription.transferFunction == CM_TRANSFER_FUNCTION_ST2084_PQ;
@@ -1540,11 +1541,13 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
}
}
- if (pMonitor->activeWorkspace && pMonitor->activeWorkspace->m_hasFullscreenWindow && pMonitor->activeWorkspace->m_fullscreenMode == FSMODE_FULLSCREEN) {
- const auto WINDOW = pMonitor->activeWorkspace->getFullscreenWindow();
- pMonitor->output->state->setContentType(NContentType::toDRM(WINDOW->getContentType()));
- } else
- pMonitor->output->state->setContentType(NContentType::toDRM(CONTENT_TYPE_NONE));
+ if (*PCT) {
+ if (pMonitor->activeWorkspace && pMonitor->activeWorkspace->m_hasFullscreenWindow && pMonitor->activeWorkspace->m_fullscreenMode == FSMODE_FULLSCREEN) {
+ const auto WINDOW = pMonitor->activeWorkspace->getFullscreenWindow();
+ pMonitor->output->state->setContentType(NContentType::toDRM(WINDOW->getContentType()));
+ } else
+ pMonitor->output->state->setContentType(NContentType::toDRM(CONTENT_TYPE_NONE));
+ }
if (pMonitor->ctmUpdated) {
pMonitor->ctmUpdated = false;