aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-10-05 01:31:13 +0100
committervaxerski <[email protected]>2023-10-05 01:31:13 +0100
commit3d1a1679604e9de18a46a9a0819daf2044b08fa6 (patch)
tree62a8ba5ff21610f9326b23e88861158ec545c638
parent1b99a69dc11c3c8266559c3c20b2f4dac6621dcc (diff)
downloadHyprland-3d1a1679604e9de18a46a9a0819daf2044b08fa6.tar.gz
Hyprland-3d1a1679604e9de18a46a9a0819daf2044b08fa6.zip
wsrules: check for workspace ID matches on numbered workspaces
fixes #3494
-rw-r--r--src/config/ConfigManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 42611be3..b675f6ea 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -1827,7 +1827,10 @@ SMonitorRule CConfigManager::getMonitorRuleFor(const std::string& name, const st
}
SWorkspaceRule CConfigManager::getWorkspaceRuleFor(CWorkspace* pWorkspace) {
- const auto IT = std::find_if(m_dWorkspaceRules.begin(), m_dWorkspaceRules.end(), [&](const auto& other) { return other.workspaceName == pWorkspace->m_szName; });
+ const auto WORKSPACEIDSTR = std::to_string(pWorkspace->m_iID);
+ const auto IT = std::find_if(m_dWorkspaceRules.begin(), m_dWorkspaceRules.end(), [&](const auto& other) {
+ return other.workspaceName == pWorkspace->m_szName || (pWorkspace->m_iID > 0 && WORKSPACEIDSTR == other.workspaceName);
+ });
if (IT == m_dWorkspaceRules.end())
return SWorkspaceRule{};
return *IT;