compositor: don't set dim percent on disabled dim

This commit is contained in:
vaxerski 2023-06-13 18:50:40 +02:00
parent 807b52b019
commit e8c6d0f51e

View file

@ -1618,6 +1618,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(CWindow* pWindow) {
static auto* const PSHADOWCOL = &g_pConfigManager->getConfigValuePtr("decoration:col.shadow")->intValue;
static auto* const PSHADOWCOLINACTIVE = &g_pConfigManager->getConfigValuePtr("decoration:col.shadow_inactive")->intValue;
static auto* const PDIMSTRENGTH = &g_pConfigManager->getConfigValuePtr("decoration:dim_strength")->floatValue;
static auto* const PDIMENABLED = &g_pConfigManager->getConfigValuePtr("decoration:dim_inactive")->intValue;
auto setBorderColor = [&](CGradientValueData grad) -> void {
if (grad == pWindow->m_cRealBorderColor)
@ -1668,7 +1669,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(CWindow* pWindow) {
}
// dim
if (pWindow == m_pLastWindow || pWindow->m_sAdditionalConfigData.forceNoDim) {
if (pWindow == m_pLastWindow || pWindow->m_sAdditionalConfigData.forceNoDim || !*PDIMENABLED) {
pWindow->m_fDimPercent = 0;
} else {
pWindow->m_fDimPercent = *PDIMSTRENGTH;