-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(config): unset values on ws configs appropriately
This commit ensures that if a user removes an optional block from the static config file, when reloading a workspace config, the removed option will also be unset in the window manager workspace configuration state.
- Loading branch information
Showing
1 changed file
with
12 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,34 +161,32 @@ impl Workspace { | |
self.tile = false; | ||
} | ||
|
||
let mut all_layout_rules = vec![]; | ||
if let Some(layout_rules) = &config.layout_rules { | ||
let mut all_rules = vec![]; | ||
for (count, rule) in layout_rules { | ||
all_rules.push((*count, Layout::Default(*rule))); | ||
all_layout_rules.push((*count, Layout::Default(*rule))); | ||
} | ||
|
||
self.set_layout_rules(all_rules); | ||
|
||
self.tile = true; | ||
} | ||
|
||
self.set_layout_rules(all_layout_rules.clone()); | ||
|
||
if let Some(layout_rules) = &config.custom_layout_rules { | ||
let rules = self.layout_rules_mut(); | ||
for (count, pathbuf) in layout_rules { | ||
let rule = CustomLayout::from_path(pathbuf)?; | ||
rules.push((*count, Layout::Custom(rule))); | ||
all_layout_rules.push((*count, Layout::Custom(rule))); | ||
} | ||
|
||
self.tile = true; | ||
self.set_layout_rules(all_layout_rules); | ||
} | ||
|
||
self.set_apply_window_based_work_area_offset( | ||
config.apply_window_based_work_area_offset.unwrap_or(true), | ||
); | ||
|
||
if config.window_container_behaviour.is_some() { | ||
self.set_window_container_behaviour(config.window_container_behaviour); | ||
} | ||
self.set_window_container_behaviour(config.window_container_behaviour); | ||
|
||
if let Some(window_container_behaviour_rules) = &config.window_container_behaviour_rules { | ||
if window_container_behaviour_rules.is_empty() { | ||
|
@@ -201,15 +199,13 @@ impl Workspace { | |
|
||
self.set_window_container_behaviour_rules(Some(all_rules)); | ||
} | ||
} else { | ||
self.set_window_container_behaviour_rules(None); | ||
self.set_window_container_behaviour(None); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
LGUG2Z
Author
Owner
|
||
} | ||
|
||
if config.float_override.is_some() { | ||
self.set_float_override(config.float_override); | ||
} | ||
|
||
if config.layout_flip.is_some() { | ||
self.set_layout_flip(config.layout_flip); | ||
} | ||
self.set_float_override(config.float_override); | ||
self.set_layout_flip(config.layout_flip); | ||
|
||
Ok(()) | ||
} | ||
|
@LGUG2Z Isn't this line overriding the one above on line 189?! If the user doesn't have
window_container_behaviour_rules
set this line is always forcing thewindow_container_behaviour
toNone
.