mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-25 01:58:51 +02:00
fix(wm): properly store tile state when caching ws
Previously, when caching a workspace config for a monitor it would simply store the `DefaultLayout` on `layout` even if the original workspace config had the `layout` as `None`, which makes komorebi create a workspace with the `layout` as default `BSP` and the `tile` set to `false`. This resulted in floating workspaces would becoming tiling `BSP` workspaces after a monitor disconnect and reconnect. This commit fixes this by turning the `layout` to `None` when `tile` is `false`.
This commit is contained in:
@@ -206,12 +206,14 @@ impl From<&Workspace> for WorkspaceConfig {
|
|||||||
.name()
|
.name()
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or_else(|| String::from("unnamed")),
|
.unwrap_or_else(|| String::from("unnamed")),
|
||||||
layout: match value.layout() {
|
|
||||||
Layout::Default(layout) => Option::from(*layout),
|
|
||||||
// TODO: figure out how we might resolve file references in the future
|
|
||||||
Layout::Custom(_) => None,
|
|
||||||
},
|
|
||||||
custom_layout: None,
|
custom_layout: None,
|
||||||
|
layout: value
|
||||||
|
.tile()
|
||||||
|
.then_some(match value.layout() {
|
||||||
|
Layout::Default(layout) => Option::from(*layout),
|
||||||
|
Layout::Custom(_) => None,
|
||||||
|
})
|
||||||
|
.flatten(),
|
||||||
layout_rules: Option::from(layout_rules),
|
layout_rules: Option::from(layout_rules),
|
||||||
// TODO: figure out how we might resolve file references in the future
|
// TODO: figure out how we might resolve file references in the future
|
||||||
custom_layout_rules: None,
|
custom_layout_rules: None,
|
||||||
|
|||||||
Reference in New Issue
Block a user