summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-07-02 13:02:48 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-07-02 13:02:48 +0200
commit738ec900f4d5c5e2b00f90e71221ca380555b874 (patch)
treefb1e8d9d77d81a43ff72d63d6ffc1b7a78ff9a14 /src/config/ConfigManager.cpp
parent86ca2833523c5d78b2288501b95fb7cc602614af (diff)
config: fix floating rules with floating-by-rule windows
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index cc926012..df698ad9 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -1779,6 +1779,10 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow) {
Debug::log(LOG, "Searching for matching rules for %s (title: %s)", appidclass.c_str(), title.c_str());
+ // since some rules will be applied later, we need to store some flags
+ bool hasFloating = pWindow->m_bIsFloating;
+ bool hasFullscreen = pWindow->m_bIsFullscreen;
+
for (auto& rule : m_dWindowRules) {
// check if we have a matching rule
if (!rule.v2) {
@@ -1821,12 +1825,12 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow) {
}
if (rule.bFloating != -1) {
- if (pWindow->m_bIsFloating != rule.bFloating)
+ if (hasFloating != rule.bFloating)
continue;
}
if (rule.bFullscreen != -1) {
- if (pWindow->m_bIsFullscreen != rule.bFullscreen)
+ if (hasFullscreen != rule.bFullscreen)
continue;
}
@@ -1844,6 +1848,11 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow) {
Debug::log(LOG, "Window rule %s -> %s matched %lx [%s]", rule.szRule.c_str(), rule.szValue.c_str(), pWindow, pWindow->m_szTitle.c_str());
returns.push_back(rule);
+
+ if (rule.szRule == "float")
+ hasFloating = true;
+ else if (rule.szRule == "fullscreen")
+ hasFullscreen = true;
}
std::vector<uint64_t> PIDs = {(uint64_t)pWindow->getPID()};