summaryrefslogtreecommitdiff
path: root/src/helpers/WLClasses.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/WLClasses.cpp')
-rw-r--r--src/helpers/WLClasses.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/helpers/WLClasses.cpp b/src/helpers/WLClasses.cpp
index 29e10a54..3a03afcd 100644
--- a/src/helpers/WLClasses.cpp
+++ b/src/helpers/WLClasses.cpp
@@ -8,16 +8,27 @@ SLayerSurface::SLayerSurface() {
}
void SLayerSurface::applyRules() {
- noAnimations = false;
- forceBlur = false;
- ignoreZero = false;
+ noAnimations = false;
+ forceBlur = false;
+ ignoreAlpha = false;
+ ignoreAlphaValue = 0.f;
for (auto& rule : g_pConfigManager->getMatchingRules(this)) {
if (rule.rule == "noanim")
noAnimations = true;
else if (rule.rule == "blur")
forceBlur = true;
- else if (rule.rule == "ignorezero")
- ignoreZero = true;
+ else if (rule.rule.find("ignorealpha") == 0 || rule.rule.find("ignorezero") == 0) {
+ const auto FIRST_SPACE_POS = rule.rule.find_first_of(' ');
+ std::string alphaValue = "";
+ if (FIRST_SPACE_POS != std::string::npos)
+ alphaValue = rule.rule.substr(FIRST_SPACE_POS + 1);
+
+ try {
+ ignoreAlpha = true;
+ if (!alphaValue.empty())
+ ignoreAlphaValue = std::stof(alphaValue);
+ } catch (...) { Debug::log(ERR, "Invalid value passed to ignoreAlpha"); }
+ }
}
} \ No newline at end of file