Skip to content

Commit

Permalink
config: Don't override fullscreen opacity if only two opacities are p…
Browse files Browse the repository at this point in the history
…rovided (hyprwm#5512)
  • Loading branch information
SoSeDiK authored and lisuke committed Apr 15, 2024
1 parent f50756b commit 211e45c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/desktop/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,19 +603,16 @@ 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);
m_sSpecialRenderData.alphaFullscreen = std::stof(r);
m_sSpecialRenderData.alpha = std::stof(r);
m_sSpecialRenderData.alphaOverride = false;
} else if (opacityIDX == 1) {
m_sSpecialRenderData.alphaInactive = std::stof(r);
m_sSpecialRenderData.alphaInactiveOverride = false;
Expand All @@ -629,6 +626,13 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
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 211e45c

Please sign in to comment.