diff options
author | thejch <[email protected]> | 2024-05-03 18:18:04 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-04 02:18:04 +0100 |
commit | 40201a760acd7c5ca10f27e7d0fdeb71c20df89f (patch) | |
tree | adddb0f871ee101cba77658fa8a048c1ae6e673d | |
parent | a3b4923c4218535878dcf68d27d8eca4ab3e0981 (diff) | |
download | Hyprland-40201a760acd7c5ca10f27e7d0fdeb71c20df89f.tar.gz Hyprland-40201a760acd7c5ca10f27e7d0fdeb71c20df89f.zip |
workspacerule: Fix monitor settings being deleted when merging ws rules (#5864)
* fix deleting monitor settings when merging rules
* use empty and workspace invalid
-rw-r--r-- | src/config/ConfigManager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 652a063c..c6c0ceaf 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -993,6 +993,15 @@ SWorkspaceRule CConfigManager::getWorkspaceRuleFor(PHLWORKSPACE pWorkspace) { SWorkspaceRule CConfigManager::mergeWorkspaceRules(const SWorkspaceRule& rule1, const SWorkspaceRule& rule2) { SWorkspaceRule mergedRule = rule1; + if (rule1.monitor.empty()) + mergedRule.monitor = rule2.monitor; + if (rule1.workspaceString.empty()) + mergedRule.workspaceString = rule2.workspaceString; + if (rule1.workspaceName.empty()) + mergedRule.workspaceName = rule2.workspaceName; + if (rule1.workspaceId == WORKSPACE_INVALID) + mergedRule.workspaceId = rule2.workspaceId; + if (rule2.isDefault) mergedRule.isDefault = true; if (rule2.isPersistent) |