diff options
| author | vaxerski <vaxry@vaxry.net> | 2025-08-21 14:59:20 +0200 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2025-08-21 14:59:20 +0200 |
| commit | 50a242f16abfc49efc6f89ea9cd14a3544888a25 (patch) | |
| tree | 1b09c821120fc011cbddea1e8fd73fdc6bd25bd1 /src | |
| parent | 1ac1ff457ab8ef1ae6a8f2ab17ee7965adfa729f (diff) | |
config: add dim_modal
fixes #11486
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compositor.cpp | 3 | ||||
| -rw-r--r-- | src/config/ConfigDescriptions.hpp | 6 | ||||
| -rw-r--r-- | src/config/ConfigManager.cpp | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index b06710f6..23b2e366 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1867,6 +1867,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) { static auto PSHADOWCOLINACTIVE = CConfigValue<Hyprlang::INT>("decoration:shadow:color_inactive"); static auto PDIMSTRENGTH = CConfigValue<Hyprlang::FLOAT>("decoration:dim_strength"); static auto PDIMENABLED = CConfigValue<Hyprlang::INT>("decoration:dim_inactive"); + static auto PDIMMODAL = CConfigValue<Hyprlang::INT>("decoration:dim_modal"); auto* const ACTIVECOL = sc<CGradientValueData*>((PACTIVECOL.ptr())->getData()); auto* const INACTIVECOL = sc<CGradientValueData*>((PINACTIVECOL.ptr())->getData()); @@ -1924,7 +1925,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) { else goalDim = *PDIMSTRENGTH; - if (IS_SHADOWED_BY_MODAL) + if (IS_SHADOWED_BY_MODAL && *PDIMMODAL) goalDim += (1.F - goalDim) / 2.F; *pWindow->m_dimPercent = goalDim; diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp index 1b3e412d..3e5d5a87 100644 --- a/src/config/ConfigDescriptions.hpp +++ b/src/config/ConfigDescriptions.hpp @@ -232,6 +232,12 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = { .data = SConfigOptionDescription::SFloatData{1, 0, 1}, }, SConfigOptionDescription{ + .value = "decoration:dim_modal", + .description = "enables dimming of parents of modal windows", + .type = CONFIG_OPTION_BOOL, + .data = SConfigOptionDescription::SBoolData{true}, + }, + SConfigOptionDescription{ .value = "decoration:dim_inactive", .description = "enables dimming of inactive windows", .type = CONFIG_OPTION_BOOL, diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 7c74534a..951a5429 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -582,6 +582,7 @@ CConfigManager::CConfigManager() { registerConfigVar("decoration:shadow:color", Hyprlang::INT{0xee1a1a1a}); registerConfigVar("decoration:shadow:color_inactive", Hyprlang::INT{-1}); registerConfigVar("decoration:dim_inactive", Hyprlang::INT{0}); + registerConfigVar("decoration:dim_modal", Hyprlang::INT{1}); registerConfigVar("decoration:dim_strength", {0.5f}); registerConfigVar("decoration:dim_special", {0.2f}); registerConfigVar("decoration:dim_around", {0.4f}); |
