summaryrefslogtreecommitdiff
path: root/src/helpers/WLClasses.cpp
diff options
context:
space:
mode:
authorTheOnlyMrCat <theonly@mrcat.au>2024-04-11 21:41:18 +1000
committerGitHub <noreply@github.com>2024-04-11 12:41:18 +0100
commit47e5b41fead236026ff7630689e677e854531c41 (patch)
tree2e32dbfa77e16872d9f526e9a0c53950226c5208 /src/helpers/WLClasses.cpp
parentac0f3411c18497a39498b756b711e092512de9e0 (diff)
renderer: Add dimaround layer rule (#4643)
Diffstat (limited to 'src/helpers/WLClasses.cpp')
-rw-r--r--src/helpers/WLClasses.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/helpers/WLClasses.cpp b/src/helpers/WLClasses.cpp
index 6135098a..2e669e4f 100644
--- a/src/helpers/WLClasses.cpp
+++ b/src/helpers/WLClasses.cpp
@@ -10,6 +10,11 @@ SLayerSurface::SLayerSurface() {
realPosition.registerVar();
realSize.registerVar();
+ alpha.setUpdateCallback([this](void*) {
+ if (dimAround)
+ g_pHyprRenderer->damageMonitor(g_pCompositor->getMonitorFromID(monitorID));
+ });
+
alpha.setValueAndWarp(0.f);
}
@@ -26,6 +31,7 @@ void SLayerSurface::applyRules() {
forceBlur = false;
ignoreAlpha = false;
ignoreAlphaValue = 0.f;
+ dimAround = false;
xray = -1;
animationStyle.reset();
@@ -47,6 +53,8 @@ void SLayerSurface::applyRules() {
if (!alphaValue.empty())
ignoreAlphaValue = std::stof(alphaValue);
} catch (...) { Debug::log(ERR, "Invalid value passed to ignoreAlpha"); }
+ } else if (rule.rule == "dimaround") {
+ dimAround = true;
} else if (rule.rule.starts_with("xray")) {
CVarList vars{rule.rule, 0, ' '};
try {