From 94bd4123c6e8fd3162e245b0d568c9d6dfd75780 Mon Sep 17 00:00:00 2001 From: ItsOhen Date: Sun, 15 Mar 2026 20:32:05 +0100 Subject: desktop/rules: fix static rules and content type. (#13725) Hopefully for the last time in a while. Also a lot easier to add in new static types with the recheck done in window map instead of the rule. --- src/desktop/view/Window.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/desktop/view/Window.cpp') diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp index 4570a901..00d32a47 100644 --- a/src/desktop/view/Window.cpp +++ b/src/desktop/view/Window.cpp @@ -1719,8 +1719,7 @@ void CWindow::mapWindow() { requestedClientFSMode = FSMODE_FULLSCREEN; MONITORID requestedFSMonitor = m_wantsInitialFullscreenMonitor; - m_ruleApplicator->readStaticRules(); - { + auto setStaticProps = [&]() { if (!m_ruleApplicator->static_.monitor.empty()) { const auto& MONITORSTR = m_ruleApplicator->static_.monitor; if (MONITORSTR == "unset") @@ -1771,8 +1770,8 @@ void CWindow::mapWindow() { if (m_ruleApplicator->static_.fullscreenStateClient || m_ruleApplicator->static_.fullscreenStateInternal) { requestedFSState = Desktop::View::SFullscreenState{ - .internal = sc(m_ruleApplicator->static_.fullscreenStateInternal.value_or(0)), - .client = sc(m_ruleApplicator->static_.fullscreenStateClient.value_or(0)), + .internal = sc(m_ruleApplicator->static_.fullscreenStateInternal.value_or(0)), + .client = sc(m_ruleApplicator->static_.fullscreenStateClient.value_or(0)), }; } @@ -1846,6 +1845,13 @@ void CWindow::mapWindow() { if (m_ruleApplicator->static_.noCloseFor) m_closeableSince = Time::steadyNow() + std::chrono::milliseconds(m_ruleApplicator->static_.noCloseFor.value()); + }; + + const bool recheck = m_ruleApplicator->readStaticRules(); + setStaticProps(); + if (recheck) { + m_ruleApplicator->recheckStaticRules(); + setStaticProps(); } // make it uncloseable if it's a Hyprland dialog -- cgit v1.2.3