mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 08:05:58 +01:00
wsrules: check for workspace ID matches on numbered workspaces
fixes #3494
This commit is contained in:
parent
1b99a69dc1
commit
3d1a167960
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue