summaryrefslogtreecommitdiff
path: root/src/config/shared
diff options
context:
space:
mode:
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:")) {