summaryrefslogtreecommitdiff
path: root/src/desktop
diff options
context:
space:
mode:
authorVirt <41426325+VirtCode@users.noreply.github.com>2025-04-25 16:38:31 +0200
committerGitHub <noreply@github.com>2025-04-25 16:38:31 +0200
commit4cf62c114e8fd2cc4fa47d07459e00c52f6dc1d3 (patch)
treecaf19b6084c2f8b4eb1e9f5c604479c99565de4e /src/desktop
parent41f5f67f6c8675ec48d893007ca93f8bf6c0049a (diff)
layerrules: add abovelock to render above lockscreen (#9793)
Diffstat (limited to 'src/desktop')
-rw-r--r--src/desktop/LayerRule.cpp6
-rw-r--r--src/desktop/LayerRule.hpp3
-rw-r--r--src/desktop/LayerSurface.cpp13
-rw-r--r--src/desktop/LayerSurface.hpp16
4 files changed, 25 insertions, 13 deletions
diff --git a/src/desktop/LayerRule.cpp b/src/desktop/LayerRule.cpp
index c03d8968..9b5f9da2 100644
--- a/src/desktop/LayerRule.cpp
+++ b/src/desktop/LayerRule.cpp
@@ -5,7 +5,7 @@
#include "../debug/Log.hpp"
static const auto RULES = std::unordered_set<std::string>{"noanim", "blur", "blurpopups", "dimaround"};
-static const auto RULES_PREFIX = std::unordered_set<std::string>{"ignorealpha", "ignorezero", "xray", "animation", "order"};
+static const auto RULES_PREFIX = std::unordered_set<std::string>{"ignorealpha", "ignorezero", "xray", "animation", "order", "abovelock"};
CLayerRule::CLayerRule(const std::string& rule_, const std::string& ns_) : m_targetNamespace(ns_), m_rule(rule_) {
const bool VALID = RULES.contains(m_rule) || std::any_of(RULES_PREFIX.begin(), RULES_PREFIX.end(), [&rule_](const auto& prefix) { return rule_.starts_with(prefix); });
@@ -31,8 +31,10 @@ CLayerRule::CLayerRule(const std::string& rule_, const std::string& ns_) : m_tar
m_ruleType = RULE_ANIMATION;
else if (m_rule.starts_with("order"))
m_ruleType = RULE_ORDER;
+ else if (m_rule.starts_with("abovelock"))
+ m_ruleType = RULE_ABOVELOCK;
else {
Debug::log(ERR, "CLayerRule: didn't match a rule that was found valid?!");
m_ruleType = RULE_INVALID;
}
-} \ No newline at end of file
+}
diff --git a/src/desktop/LayerRule.hpp b/src/desktop/LayerRule.hpp
index 46f843a6..0463196e 100644
--- a/src/desktop/LayerRule.hpp
+++ b/src/desktop/LayerRule.hpp
@@ -14,6 +14,7 @@ class CLayerRule {
RULE_BLUR,
RULE_BLURPOPUPS,
RULE_DIMAROUND,
+ RULE_ABOVELOCK,
RULE_IGNOREALPHA,
RULE_IGNOREZERO,
RULE_XRAY,
@@ -28,4 +29,4 @@ class CLayerRule {
const std::string m_rule;
CRuleRegexContainer m_targetNamespaceRegex;
-}; \ No newline at end of file
+};
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp
index b44f652b..96c6200e 100644
--- a/src/desktop/LayerSurface.cpp
+++ b/src/desktop/LayerSurface.cpp
@@ -421,9 +421,8 @@ void CLayerSurface::applyRules() {
}
case CLayerRule::RULE_XRAY: {
CVarList vars{rule->m_rule, 0, ' '};
- try {
- m_xray = configStringToInt(vars[1]).value_or(false);
- } catch (...) {}
+ m_xray = configStringToInt(vars[1]).value_or(false);
+
break;
}
case CLayerRule::RULE_ANIMATION: {
@@ -438,6 +437,14 @@ void CLayerSurface::applyRules() {
} catch (...) { Debug::log(ERR, "Invalid value passed to order"); }
break;
}
+ case CLayerRule::RULE_ABOVELOCK: {
+ m_aboveLockscreen = true;
+
+ CVarList vars{rule->m_rule, 0, ' '};
+ m_aboveLockscreenInteractable = configStringToInt(vars[1]).value_or(false);
+
+ break;
+ }
default: break;
}
}
diff --git a/src/desktop/LayerSurface.hpp b/src/desktop/LayerSurface.hpp
index 6282d55f..b80d88de 100644
--- a/src/desktop/LayerSurface.hpp
+++ b/src/desktop/LayerSurface.hpp
@@ -43,13 +43,15 @@ class CLayerSurface {
bool m_noProcess = false;
bool m_noAnimations = false;
- bool m_forceBlur = false;
- bool m_forceBlurPopups = false;
- int64_t m_xray = -1;
- bool m_ignoreAlpha = false;
- float m_ignoreAlphaValue = 0.f;
- bool m_dimAround = false;
- int64_t m_order = 0;
+ bool m_forceBlur = false;
+ bool m_forceBlurPopups = false;
+ int64_t m_xray = -1;
+ bool m_ignoreAlpha = false;
+ float m_ignoreAlphaValue = 0.f;
+ bool m_dimAround = false;
+ int64_t m_order = 0;
+ bool m_aboveLockscreen = false;
+ bool m_aboveLockscreenInteractable = false;
std::optional<std::string> m_animationStyle;