From 1edeb44203e1c09ab1bfeb8a16494a3c5e7be954 Mon Sep 17 00:00:00 2001 From: alex-ds13 <145657253+alex-ds13@users.noreply.github.com> Date: Sat, 22 Feb 2025 17:08:59 +0000 Subject: [PATCH] fix(wm): include workspace rules on cached monitor The `WorkspaceConfig` stored on `Workspace` was changed to not be serialized, however it needs to be serialized and deserialized when caching a monitor (after a disconnect), so that when it reconnects it is able to read all the workspace rules, which include: - initial_workspace_rules - workspace_rules - window_container_behaviour_rules - layout_rules - custom_layout_rules This commit changes the serde skip to only skip if is is `None`. This means that the `komorebic state` command will have all this information as well and it will send it when notifying subscribers too, which isn't good at all, so we need to find another way of excluding it from the state. --- komorebi/src/workspace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index b8ae9b2c..4c036dbb 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -92,7 +92,7 @@ pub struct Workspace { window_container_behaviour_rules: Option>, #[getset(get = "pub", get_mut = "pub", set = "pub")] float_override: Option, - #[serde(skip)] + #[serde(skip_serializing_if = "Option::is_none")] #[getset(get = "pub", set = "pub")] workspace_config: Option, }