Skip to content

Commit

Permalink
Don't override fullscreen opacity if only two opacities are provided
Browse files Browse the repository at this point in the history
  • Loading branch information
SoSeDiK committed Apr 9, 2024
1 parent d0d1ba5 commit 0850f28
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/desktop/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,32 +603,32 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
continue;

if (r == "override") {
if (opacityIDX == 1) {
m_sSpecialRenderData.alphaOverride = true;
m_sSpecialRenderData.alphaInactiveOverride = true;
m_sSpecialRenderData.alphaFullscreenOverride = true;
} else if (opacityIDX == 2)
if (opacityIDX == 1)
m_sSpecialRenderData.alphaOverride = true;
else if (opacityIDX == 2)
m_sSpecialRenderData.alphaInactiveOverride = true;
else if (opacityIDX == 3)
m_sSpecialRenderData.alphaFullscreenOverride = true;
} else {
if (opacityIDX == 0) {
m_sSpecialRenderData.alpha = std::stof(r);
m_sSpecialRenderData.alphaInactive = std::stof(r);
if (opacityIDX == 0)
m_sSpecialRenderData.alpha = std::stof(r);
else if (opacityIDX == 1)
m_sSpecialRenderData.alphaInactive = std::stof(r);
else if (opacityIDX == 2)
m_sSpecialRenderData.alphaFullscreen = std::stof(r);
} else if (opacityIDX == 1) {
m_sSpecialRenderData.alphaInactive = std::stof(r);
m_sSpecialRenderData.alphaInactiveOverride = false;
} else if (opacityIDX == 2) {
m_sSpecialRenderData.alphaFullscreen = std::stof(r);
m_sSpecialRenderData.alphaFullscreenOverride = false;
} else {
else
throw std::runtime_error("more than 3 alpha values");
}

opacityIDX++;
}
}

if (opacityIDX == 1) {
m_sSpecialRenderData.alphaInactiveOverride = m_sSpecialRenderData.alphaOverride;
m_sSpecialRenderData.alphaInactive = m_sSpecialRenderData.alpha;
m_sSpecialRenderData.alphaFullscreenOverride = m_sSpecialRenderData.alphaOverride;
m_sSpecialRenderData.alphaFullscreen = m_sSpecialRenderData.alpha;
}
} catch (std::exception& e) { Debug::log(ERR, "Opacity rule \"{}\" failed with: {}", r.szRule, e.what()); }
} else if (r.szRule == "noanim") {
m_sAdditionalConfigData.forceNoAnims = true;
Expand Down

0 comments on commit 0850f28

Please sign in to comment.