summaryrefslogtreecommitdiff
path: root/src/config/shared
diff options
context:
space:
mode:
authorshezdy <77217897+shezdy@users.noreply.github.com>2026-04-30 13:10:03 -0600
committerGitHub <noreply@github.com>2026-04-30 20:10:03 +0100
commit546cc71565cd2ccd9277febb14dcebf513ace623 (patch)
treefe0cbe8e7e415f77158965cd11925572efc30fb7 /src/config/shared
parentbac49db9a11d5398963f4ad3265a577f8e94dc66 (diff)
config/workspace-rules: support modifying persistent and monitor (#14217)
* workspace rules: support modifying persistent and monitor * support modifying isDefault
Diffstat (limited to 'src/config/shared')
-rw-r--r--src/config/shared/workspace/WorkspaceRule.cpp10
-rw-r--r--src/config/shared/workspace/WorkspaceRule.hpp4
-rw-r--r--src/config/shared/workspace/WorkspaceRuleManager.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/config/shared/workspace/WorkspaceRule.cpp b/src/config/shared/workspace/WorkspaceRule.cpp
index 28d5fcab..dfd77d42 100644
--- a/src/config/shared/workspace/WorkspaceRule.cpp
+++ b/src/config/shared/workspace/WorkspaceRule.cpp
@@ -3,7 +3,7 @@
using namespace Config;
void CWorkspaceRule::mergeLeft(const CWorkspaceRule& other) {
- if (m_monitor.empty())
+ if (!other.m_monitor.empty())
m_monitor = other.m_monitor;
if (m_workspaceString.empty())
m_workspaceString = other.m_workspaceString;
@@ -12,10 +12,10 @@ void CWorkspaceRule::mergeLeft(const CWorkspaceRule& other) {
if (m_workspaceId == WORKSPACE_INVALID)
m_workspaceId = other.m_workspaceId;
- if (other.m_isDefault)
- m_isDefault = true;
- if (other.m_isPersistent)
- m_isPersistent = true;
+ if (other.m_isDefault.has_value())
+ m_isDefault = other.m_isDefault;
+ if (other.m_isPersistent.has_value())
+ m_isPersistent = other.m_isPersistent;
if (other.m_gapsIn.has_value())
m_gapsIn = other.m_gapsIn;
if (other.m_gapsOut.has_value())
diff --git a/src/config/shared/workspace/WorkspaceRule.hpp b/src/config/shared/workspace/WorkspaceRule.hpp
index 5d63e434..e56a1366 100644
--- a/src/config/shared/workspace/WorkspaceRule.hpp
+++ b/src/config/shared/workspace/WorkspaceRule.hpp
@@ -27,8 +27,8 @@ namespace Config {
std::string m_workspaceString = "";
std::string m_workspaceName = "";
WORKSPACEID m_workspaceId = -1;
- bool m_isDefault = false;
- bool m_isPersistent = false;
+ std::optional<bool> m_isDefault;
+ std::optional<bool> m_isPersistent;
std::optional<CCssGapData> m_gapsIn;
std::optional<CCssGapData> m_gapsOut;
std::optional<CCssGapData> m_floatGaps = m_gapsOut;
diff --git a/src/config/shared/workspace/WorkspaceRuleManager.cpp b/src/config/shared/workspace/WorkspaceRuleManager.cpp
index 4c2c2b90..04b94a53 100644
--- a/src/config/shared/workspace/WorkspaceRuleManager.cpp
+++ b/src/config/shared/workspace/WorkspaceRuleManager.cpp
@@ -55,7 +55,7 @@ std::string CWorkspaceRuleManager::getDefaultWorkspaceFor(const std::string& nam
if (!other->m_enabled)
continue;
- if (other->m_isDefault) {
+ if (other->m_isDefault.value_or(false)) {
if (other->m_monitor == name)
return other->m_workspaceString;
if (other->m_monitor.starts_with("desc:")) {