fix(wm): populate ws rules on config reload

This commit fixes a bug where workspace rules would not be populated
properly on file reloads, leading to issues with the
ReplaceConfiguration message handler.
This commit is contained in:
LGUG2Z
2025-01-24 14:37:42 -08:00
parent f73f0a0012
commit fcd1c9dcbe
2 changed files with 5 additions and 2 deletions

View File

@@ -1315,6 +1315,8 @@ impl WindowManager {
// Initialize the new wm
wm.init()?;
wm.restore_all_windows(true)?;
// This is equivalent to StaticConfig::postload for this use case
StaticConfig::reload(config, &mut wm)?;

View File

@@ -1220,6 +1220,9 @@ impl StaticConfig {
value.apply_globals()?;
if let Some(monitors) = value.monitors {
let mut workspace_matching_rules = WORKSPACE_MATCHING_RULES.lock();
workspace_matching_rules.clear();
for (i, monitor) in monitors.iter().enumerate() {
if let Some(m) = wm.monitors_mut().get_mut(i) {
m.ensure_workspace_count(monitor.workspaces.len());
@@ -1238,8 +1241,6 @@ impl StaticConfig {
}
}
let mut workspace_matching_rules = WORKSPACE_MATCHING_RULES.lock();
workspace_matching_rules.clear();
for (j, ws) in monitor.workspaces.iter().enumerate() {
if let Some(rules) = &ws.workspace_rules {
for r in rules {