windowrules: add modal prop (#12024)

adds a modal prop for targeting modal windows with rules
This commit is contained in:
Vaxry 2025-10-13 14:16:48 +02:00 committed by GitHub
parent 7fcaf332e8
commit 4b55ec6830
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -1562,6 +1562,11 @@ std::vector<SP<CWindowRule>> CConfigManager::getMatchingRules(PHLWINDOW pWindow,
continue;
}
if (rule->m_modal != -1) {
if (rule->m_modal != pWindow->isModal())
continue;
}
if (!rule->m_fullscreenState.empty()) {
const auto ARGS = CVarList(rule->m_fullscreenState, 2, ' ');
//
@ -2735,6 +2740,8 @@ std::optional<std::string> CConfigManager::handleWindowRule(const std::string& c
set |= (rule->m_focus = (v == "1"), true);
if (auto v = get("group"); !v.empty())
set |= (rule->m_group = (v == "1"), true);
if (auto v = get("modal"); !v.empty())
set |= (rule->m_modal = (v == "1"), true);
if (auto v = get("fullscreenstate"); !v.empty())
set |= (rule->m_fullscreenState = v, true);
@ -2797,6 +2804,8 @@ std::optional<std::string> CConfigManager::handleWindowRule(const std::string& c
return false;
if (rule->m_group != -1 && rule->m_group != other->m_group)
return false;
if (rule->m_modal != -1 && rule->m_modal != other->m_modal)
return false;
return true;
});
} else {