diff --git a/src/Compositor.cpp b/src/Compositor.cpp index e6a3d993..cfbc11b5 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1665,7 +1665,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(CWindow* pWindow) { } // dim - if (pWindow == m_pLastWindow) { + if (pWindow == m_pLastWindow || pWindow->m_sAdditionalConfigData.forceNoDim) { pWindow->m_fDimPercent = 0; } else { pWindow->m_fDimPercent = *PDIMSTRENGTH; diff --git a/src/Window.cpp b/src/Window.cpp index 01d337e8..a9598615 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -435,6 +435,8 @@ void CWindow::applyDynamicRule(const SWindowRule& r) { m_sAdditionalConfigData.forceNoBorder = true; } else if (r.szRule == "noshadow") { m_sAdditionalConfigData.forceNoShadow = true; + } else if (r.szRule == "nodim") { + m_sAdditionalConfigData.forceNoDim = true; } else if (r.szRule == "forcergbx") { m_sAdditionalConfigData.forceRGBX = true; } else if (r.szRule == "opaque") { @@ -495,6 +497,7 @@ void CWindow::updateDynamicRules() { m_sAdditionalConfigData.forceNoBlur = false; m_sAdditionalConfigData.forceNoBorder = false; m_sAdditionalConfigData.forceNoShadow = false; + m_sAdditionalConfigData.forceNoDim = false; if (!m_sAdditionalConfigData.forceOpaqueOverridden) m_sAdditionalConfigData.forceOpaque = false; m_sAdditionalConfigData.forceNoAnims = false; diff --git a/src/Window.hpp b/src/Window.hpp index 164c5ee2..660abb61 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -10,8 +10,7 @@ #include "helpers/Vector2D.hpp" #include "helpers/WLSurface.hpp" -enum eIdleInhibitMode -{ +enum eIdleInhibitMode { IDLEINHIBIT_NONE = 0, IDLEINHIBIT_ALWAYS, IDLEINHIBIT_FULLSCREEN, @@ -117,6 +116,7 @@ struct SWindowAdditionalConfigData { CWindowOverridableVar forceNoAnims = false; CWindowOverridableVar forceNoBorder = false; CWindowOverridableVar forceNoShadow = false; + CWindowOverridableVar forceNoDim = false; CWindowOverridableVar windowDanceCompat = false; CWindowOverridableVar noMaxSize = false; CWindowOverridableVar dimAround = false; diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 481edf18..99e7d99b 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -856,10 +856,10 @@ void CConfigManager::handleUnbind(const std::string& command, const std::string& bool windowRuleValid(const std::string& RULE) { return !(RULE != "float" && RULE != "tile" && RULE.find("opacity") != 0 && RULE.find("move") != 0 && RULE.find("size") != 0 && RULE.find("minsize") != 0 && RULE.find("maxsize") != 0 && RULE.find("pseudo") != 0 && RULE.find("monitor") != 0 && RULE.find("idleinhibit") != 0 && RULE != "nofocus" && RULE != "noblur" && - RULE != "noshadow" && RULE != "noborder" && RULE != "center" && RULE != "opaque" && RULE != "forceinput" && RULE != "fullscreen" && RULE != "nofullscreenrequest" && - RULE != "fakefullscreen" && RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && RULE != "dimaround" && RULE != "windowdance" && RULE != "maximize" && - RULE.find("animation") != 0 && RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && RULE.find("bordercolor") != 0 && RULE != "forcergbx" && - RULE != "noinitialfocus"); + RULE != "noshadow" && RULE != "nodim" && RULE != "noborder" && RULE != "center" && RULE != "opaque" && RULE != "forceinput" && RULE != "fullscreen" && + RULE != "nofullscreenrequest" && RULE != "fakefullscreen" && RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && RULE != "dimaround" && + RULE != "windowdance" && RULE != "maximize" && RULE.find("animation") != 0 && RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && + RULE.find("bordercolor") != 0 && RULE != "forcergbx" && RULE != "noinitialfocus"); } bool layerRuleValid(const std::string& RULE) { diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index d824cfad..0b2a0d48 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -952,6 +952,8 @@ std::string dispatchSetProp(std::string request) { PWINDOW->m_sAdditionalConfigData.forceNoBorder.forceSetIgnoreLocked(configStringToInt(VAL), lock); } else if (PROP == "forcenoshadow") { PWINDOW->m_sAdditionalConfigData.forceNoShadow.forceSetIgnoreLocked(configStringToInt(VAL), lock); + } else if (PROP == "forcenodim") { + PWINDOW->m_sAdditionalConfigData.forceNoDim.forceSetIgnoreLocked(configStringToInt(VAL), lock); } else if (PROP == "windowdancecompat") { PWINDOW->m_sAdditionalConfigData.windowDanceCompat.forceSetIgnoreLocked(configStringToInt(VAL), lock); } else if (PROP == "nomaxsize") { diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index d1cb72f0..b64bb193 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -438,7 +438,7 @@ void Events::listener_mapWindow(void* owner, void* data) { (PWINDOW->m_iX11Type != 2 || (PWINDOW->m_bIsX11 && wlr_xwayland_or_surface_wants_focus(PWINDOW->m_uSurface.xwayland))) && !workspaceSilent) { g_pCompositor->focusWindow(PWINDOW); PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PACTIVEALPHA); - PWINDOW->m_fDimPercent.setValueAndWarp(*PDIMSTRENGTH); + PWINDOW->m_fDimPercent.setValueAndWarp(PWINDOW->m_sAdditionalConfigData.forceNoDim ? 0.f : *PDIMSTRENGTH); } else { PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PINACTIVEALPHA); PWINDOW->m_fDimPercent.setValueAndWarp(0);