diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-03-20 13:52:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-20 17:52:37 +0000 |
| commit | 8726a7363eb9213235e6e23657668e0daac39a5b (patch) | |
| tree | 42eeb40f6f81a9ccec1455f308e56173e9dcce4b /src/config/shared/workspace/WorkspaceRule.cpp | |
| parent | b940b0d2c197841b0f648598ee782dbaf9e0a89b (diff) | |
config: cleanup the entire config infrastructure (#13785)
Massively refactors the config infrastructure, sorely
needed and will be req'd for the lua stuff
Diffstat (limited to 'src/config/shared/workspace/WorkspaceRule.cpp')
| -rw-r--r-- | src/config/shared/workspace/WorkspaceRule.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/config/shared/workspace/WorkspaceRule.cpp b/src/config/shared/workspace/WorkspaceRule.cpp new file mode 100644 index 00000000..28d5fcab --- /dev/null +++ b/src/config/shared/workspace/WorkspaceRule.cpp @@ -0,0 +1,48 @@ +#include "WorkspaceRule.hpp" + +using namespace Config; + +void CWorkspaceRule::mergeLeft(const CWorkspaceRule& other) { + if (m_monitor.empty()) + m_monitor = other.m_monitor; + if (m_workspaceString.empty()) + m_workspaceString = other.m_workspaceString; + if (m_workspaceName.empty()) + m_workspaceName = other.m_workspaceName; + 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_gapsIn.has_value()) + m_gapsIn = other.m_gapsIn; + if (other.m_gapsOut.has_value()) + m_gapsOut = other.m_gapsOut; + if (other.m_floatGaps) + m_floatGaps = other.m_floatGaps; + if (other.m_borderSize.has_value()) + m_borderSize = other.m_borderSize; + if (other.m_noBorder.has_value()) + m_noBorder = other.m_noBorder; + if (other.m_noRounding.has_value()) + m_noRounding = other.m_noRounding; + if (other.m_decorate.has_value()) + m_decorate = other.m_decorate; + if (other.m_noShadow.has_value()) + m_noShadow = other.m_noShadow; + if (other.m_onCreatedEmptyRunCmd.has_value()) + m_onCreatedEmptyRunCmd = other.m_onCreatedEmptyRunCmd; + if (other.m_defaultName.has_value()) + m_defaultName = other.m_defaultName; + if (other.m_layout.has_value()) + m_layout = other.m_layout; + if (!other.m_layoutopts.empty()) { + for (const auto& layoutopt : other.m_layoutopts) { + m_layoutopts[layoutopt.first] = layoutopt.second; + } + } + if (other.m_animationStyle.has_value()) + m_animationStyle = other.m_animationStyle; +} |
