diff --git a/common/config.go b/common/config.go index a0d5015..9989313 100644 --- a/common/config.go +++ b/common/config.go @@ -19,6 +19,8 @@ var ( ) type Configuration struct { + CacheWorkspaces bool `toml:"cache_workspaces"` // Cache workspace properties (Tiling enablement, Current layout, proportions) + CacheWindows bool `toml:"cache_windows"` // Cache window properties ( Positions, Dimensions) TilingEnabled bool `toml:"tiling_enabled"` // Tile windows on startup TilingLayout string `toml:"tiling_layout"` // Initial tiling layout TilingCycle []string `toml:"tiling_cycle"` // Cycle layout order diff --git a/config.toml b/config.toml index 387e6dd..4a828b9 100644 --- a/config.toml +++ b/config.toml @@ -9,6 +9,12 @@ # Initial tiling activation, will be cached afterwards (true | false). tiling_enabled = true +# Cache Workspace Tiling enablement, current layouts, etc +cache_workspaces = true + +# Do not cache window positions +cache_windows = false + # Initial tiling layout, will be cached afterwards ("vertical-left" | "vertical-right" | "horizontal-top" | "horizontal-bottom" | "maximized" | "fullscreen"). tiling_layout = "vertical-right" diff --git a/desktop/workspace.go b/desktop/workspace.go index 6330e5b..5b879e5 100644 --- a/desktop/workspace.go +++ b/desktop/workspace.go @@ -235,7 +235,7 @@ func (ws *Workspace) Restore(flag uint8) { } func (ws *Workspace) Write() { - if common.CacheDisabled() { + if common.CacheDisabled() || !common.Config.CacheWorkspaces { return } @@ -261,7 +261,7 @@ func (ws *Workspace) Write() { } func (ws *Workspace) Read() *Workspace { - if common.CacheDisabled() { + if common.CacheDisabled() || !common.Config.CacheWorkspaces { return ws } diff --git a/store/client.go b/store/client.go index 7be171f..d835105 100644 --- a/store/client.go +++ b/store/client.go @@ -342,7 +342,7 @@ func (c *Client) Update() { } func (c *Client) Write() { - if common.CacheDisabled() { + if common.CacheDisabled() || !common.Config.CacheWindows { return } @@ -368,7 +368,7 @@ func (c *Client) Write() { } func (c *Client) Read() *Client { - if common.CacheDisabled() { + if common.CacheDisabled() || !common.Config.CacheWindows { return c }