summaryrefslogtreecommitdiff
path: root/src/desktop
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-04-29 18:14:02 +0100
committerVaxry <vaxry@vaxry.net>2025-04-29 18:14:02 +0100
commitb10a43dabc0d65a03a3a169ff292f0f18d9c6640 (patch)
treeba93bdd1b1a1235ae0bd16f7569815dd8d224250 /src/desktop
parent5bd7ff884dc613ad22ecd227d41ce6ad7ee336df (diff)
windowrules: add noclosefor
fixes #10027
Diffstat (limited to 'src/desktop')
-rw-r--r--src/desktop/Window.hpp3
-rw-r--r--src/desktop/WindowRule.cpp8
-rw-r--r--src/desktop/WindowRule.hpp3
3 files changed, 10 insertions, 4 deletions
diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp
index 8a6590bd..cc62dd3b 100644
--- a/src/desktop/Window.hpp
+++ b/src/desktop/Window.hpp
@@ -311,6 +311,9 @@ class CWindow {
// ANR
PHLANIMVAR<float> m_notRespondingTint;
+ // For the noclosefor windowrule
+ Time::steady_tp m_closeableSince = Time::steadyNow();
+
// For the list lookup
bool operator==(const CWindow& rhs) const {
return m_xdgSurface == rhs.m_xdgSurface && m_xwaylandSurface == rhs.m_xwaylandSurface && m_position == rhs.m_position && m_size == rhs.m_size &&
diff --git a/src/desktop/WindowRule.cpp b/src/desktop/WindowRule.cpp
index 245d1583..db1b0dde 100644
--- a/src/desktop/WindowRule.cpp
+++ b/src/desktop/WindowRule.cpp
@@ -8,9 +8,9 @@ static const auto RULES = std::unordered_set<std::string>{
"float", "fullscreen", "maximize", "noinitialfocus", "pin", "stayfocused", "tile", "renderunfocused", "persistentsize",
};
static const auto RULES_PREFIX = std::unordered_set<std::string>{
- "animation", "bordercolor", "bordersize", "center", "content", "fullscreenstate", "group", "idleinhibit", "maxsize", "minsize",
- "monitor", "move", "opacity", "plugin:", "prop", "pseudo", "rounding", "roundingpower", "scrollmouse", "scrolltouchpad",
- "size", "suppressevent", "tag", "workspace", "xray",
+ "animation", "bordercolor", "bordersize", "center", "content", "fullscreenstate", "group", "idleinhibit", "maxsize", "minsize", "monitor",
+ "move", "noclosefor", "opacity", "plugin:", "prop", "pseudo", "rounding", "roundingpower", "scrollmouse", "scrolltouchpad", "size",
+ "suppressevent", "tag", "workspace", "xray",
};
CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool isV2, bool isExecRule) : m_value(value), m_rule(rule), m_v2(isV2), m_execRule(isExecRule) {
@@ -79,6 +79,8 @@ CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool
m_ruleType = RULE_PROP;
else if (rule.starts_with("content"))
m_ruleType = RULE_CONTENT;
+ else if (rule.starts_with("noclosefor"))
+ m_ruleType = RULE_NOCLOSEFOR;
else {
// check if this is a prop.
const CVarList VARS(rule, 0, 's', true);
diff --git a/src/desktop/WindowRule.hpp b/src/desktop/WindowRule.hpp
index 084c67f9..9af3909a 100644
--- a/src/desktop/WindowRule.hpp
+++ b/src/desktop/WindowRule.hpp
@@ -37,7 +37,8 @@ class CWindowRule {
RULE_WORKSPACE,
RULE_PROP,
RULE_CONTENT,
- RULE_PERSISTENTSIZE
+ RULE_PERSISTENTSIZE,
+ RULE_NOCLOSEFOR,
};
eRuleType m_ruleType = RULE_INVALID;