summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-09-12 21:05:52 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-09-12 21:05:52 +0200
commit006228109281ed4d07ace635cf419c605d62e4a6 (patch)
tree41f723bf0addc7d35ee341c151169a32a4f043ec /src/config/ConfigManager.cpp
parent81f267dff95f16a6442688dbeaf25fb01b818a04 (diff)
added wsbind
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index d25ea2cb..96a8f4da 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -913,6 +913,13 @@ void CConfigManager::handleSource(const std::string& command, const std::string&
}
}
+void CConfigManager::handleBindWS(const std::string& command, const std::string& value) {
+ const auto WS = value.substr(0, value.find_first_of(','));
+ const auto MON = value.substr(value.find_first_of(',') + 1);
+
+ boundWorkspaces.push_back({WS, MON});
+}
+
std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::string& VALUE, bool dynamic) {
if (dynamic) {
parseError = "";
@@ -941,6 +948,7 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::
else if (COMMAND == "source") handleSource(COMMAND, VALUE);
else if (COMMAND == "submap") handleSubmap(COMMAND, VALUE);
else if (COMMAND == "blurls") handleBlurLS(COMMAND, VALUE);
+ else if (COMMAND == "wsbind") handleBindWS(COMMAND, VALUE);
else
configSetValueSafe(currentCategory + (currentCategory == "" ? "" : ":") + COMMAND, VALUE);
@@ -1052,6 +1060,7 @@ void CConfigManager::loadConfigLoadVars() {
configDynamicVars.clear();
deviceConfigs.clear();
m_dBlurLSNamespaces.clear();
+ boundWorkspaces.clear();
setDefaultAnimationVars(); // reset anims
// paths
@@ -1500,3 +1509,15 @@ void CConfigManager::addParseError(const std::string& err) {
if (parseError == "")
parseError = err;
}
+
+CMonitor* CConfigManager::getBoundMonitorForWS(std::string wsname) {
+ for (auto&[ws, mon] : boundWorkspaces) {
+ const auto WSNAME = ws.find("name:") == 0 ? ws.substr(5) : ws;
+
+ if (WSNAME == wsname) {
+ return g_pCompositor->getMonitorFromString(mon);
+ }
+ }
+
+ return nullptr;
+}