From aae649b1f2d1e64a31f7d66e2156c1f56f832c5f Mon Sep 17 00:00:00 2001 From: alexdenerqal <155299301+alexdenerqal@users.noreply.github.com> Date: Sat, 30 Mar 2024 09:32:52 +0100 Subject: [PATCH] feat: add option to disable realigning working set windows on show/hide (#21) --- src/backend/common.rs | 2 +- src/config.rs | 3 +++ src/res/config.yaml | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend/common.rs b/src/backend/common.rs index 16d963d..842f1c7 100644 --- a/src/backend/common.rs +++ b/src/backend/common.rs @@ -150,7 +150,7 @@ where self.overlays.values_mut().for_each(|o| { if o.state.show_hide { o.state.want_visible = !any_shown; - if o.state.want_visible && o.state.recenter { + if o.state.want_visible && app.session.config.realign_on_showhide && o.state.recenter { o.state.reset(app, false); } } diff --git a/src/config.rs b/src/config.rs index dbc101b..6d9e890 100644 --- a/src/config.rs +++ b/src/config.rs @@ -148,6 +148,9 @@ pub struct GeneralConfig { #[serde(default = "def_true")] pub allow_sliding: bool, + + #[serde(default = "def_true")] + pub realign_on_showhide: bool, } impl GeneralConfig { diff --git a/src/res/config.yaml b/src/res/config.yaml index 33fa4eb..52bf9bb 100644 --- a/src/res/config.yaml +++ b/src/res/config.yaml @@ -15,3 +15,7 @@ watch_scale: 1.0 # Enable / disable sliding windows back and forth with the scroll action # Default: true allow_sliding: true + +# Enable / disable realigning the working set windows when they are shown/hidden +# Default: true +realign_on_showhide: true