From 038c0c693b3897021643cc89640d6fe923dc70ec Mon Sep 17 00:00:00 2001 From: Lampros Pitsillos Date: Wed, 6 Sep 2023 15:27:43 +0300 Subject: [PATCH] Renamed rule from maxsize->maxclients --- src/config/ConfigManager.cpp | 4 ++-- src/config/ConfigManager.hpp | 2 +- src/events/Windows.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 5f7c5191..20a70b84 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1158,8 +1158,8 @@ void CConfigManager::handleWorkspaceRules(const std::string& command, const std: wsRule.monitor = rule.substr(delim + 8); else if ((delim = rule.find("default:")) != std::string::npos) wsRule.isDefault = configStringToInt(rule.substr(delim + 8)); - else if ((delim = rule.find("maxsize:")) != std::string::npos) - wsRule.maxSize = configStringToInt(rule.substr(delim + 8)); + else if ((delim = rule.find("maxclients:")) != std::string::npos) + wsRule.maxClients = configStringToInt(rule.substr(delim + 11)); }; size_t pos = 0; diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index 26b18dca..4c1c860a 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -42,7 +42,7 @@ struct SWorkspaceRule { std::string workspaceName = ""; int workspaceId = -1; bool isDefault = false; - int maxSize = 0; + int maxClients = 0; std::optional gapsIn; std::optional gapsOut; std::optional borderSize; diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index b8cc8769..be7d0fbe 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -577,8 +577,8 @@ void Events::listener_mapWindow(void* owner, void* data) { auto workspaceRule = pWorkspace ? g_pConfigManager->getWorkspaceRuleFor(pWorkspace) : SWorkspaceRule{}; const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); - int maxSize = workspaceRule.maxSize; - if (maxSize != 0 && maxSize < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) { + int maxClients = workspaceRule.maxClients; + if (maxClients != 0 && maxClients < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) { if (pWorkspace->m_bIsSpecialWorkspace) { g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace)); PMONITOR->setSpecialWorkspace(nullptr); @@ -586,8 +586,8 @@ void Events::listener_mapWindow(void* owner, void* data) { pWorkspace = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace); workspaceRule = pWorkspace ? g_pConfigManager->getWorkspaceRuleFor(pWorkspace) : SWorkspaceRule{}; - maxSize = workspaceRule.maxSize; - if (maxSize != 0 && maxSize < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) { + maxClients = workspaceRule.maxClients; + if (maxClients != 0 && maxClients < g_pCompositor->getVisibleWindowsOnWorkspace(pWorkspace->m_iID)) { std::string requestedWorkspaceName; const int REQUESTEDWORKSPACEID = getWorkspaceIDFromString("empty", requestedWorkspaceName); // doesn't exist since it's empty