srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/config/src/engine/support.rs
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2024-08-24 09:11:00 +0200
committersrdusr <[email protected]>2024-08-24 09:11:00 +0200
commitadc1a56982c70c06a0f8549c2c1b3bddd17930c2 (patch)
tree16cba43721238f88a25b8fd3cadfe3382c399fab /crates/config/src/engine/support.rs
parent281378656bdf9520e5f89d31864b9b2f822d4e3e (diff)
downloadsrdwm-adc1a56982c70c06a0f8549c2c1b3bddd17930c2.tar.gz
srdwm-adc1a56982c70c06a0f8549c2c1b3bddd17930c2.zip
Implement general.focus_follows_mouse/auto_raise; remove the rest as dead
Auditing "clicking behavior and basics": general.focus_follows_mouse, general.mouse_follows_focus, general.auto_raise, general.auto_focus, the entire window.* namespace (8 more keys, a full duplicate of the same four plus remember_position/size/state), and general. smart_placement/border_width were all seeded into default_config() and documented in DEFAULTS.md, but none were read anywhere - srd.set()/ srd.get() on any of them silently succeeded while doing nothing. focus_follows_mouse is real, well-defined, and directly relevant to clicking basics - implemented it plus auto_raise (raise, not just focus, on hover) rather than just deleting the promise like the others. WindowManager gained focus_follows_mouse/auto_raise bools, wired from apply_general_settings the same way every other general.* flag is. handle_pointer_position now tracks whichever window (content or decoration) is under the pointer and, when the setting is on and that differs from the currently-focused window, focuses it through the same focus_window() free function every click-driven focus change already uses (real keyboard focus, not just core state) - skipped entirely while dragging/resizing or over a layer-shell surface, so the pointer sweeping over other windows mid-drag or hovering a bar can't steal focus from what's actually being manipulated. mouse_follows_focus (pointer warp on keybinding-driven focus change) and auto_focus (no clear distinct meaning beyond click-to-focus) stay unimplemented and are now undocumented rather than promised.
Diffstat (limited to 'crates/config/src/engine/support.rs')
-rw-r--r--crates/config/src/engine/support.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/crates/config/src/engine/support.rs b/crates/config/src/engine/support.rs
index 7b42f53..9346499 100644
--- a/crates/config/src/engine/support.rs
+++ b/crates/config/src/engine/support.rs
@@ -152,9 +152,12 @@ pub(super) fn default_config() -> HashMap<String, ConfigValue> {
// apart from "user explicitly chose a value" and hand the *unset* case
// to whichever backend ends up connecting instead of deciding for it.
set("general.focus_follows_mouse", Bool(false));
- set("general.mouse_follows_focus", Bool(true));
set("general.auto_raise", Bool(false));
- set("general.auto_focus", Bool(true));
+ // `mouse_follows_focus` (warp the pointer to match a keybinding-driven
+ // focus change, the reverse of the two above) and `auto_focus` (no
+ // clear distinct meaning found beyond what plain click-to-focus already
+ // does) are deliberately not seeded - neither is implemented, same
+ // reasoning as `workspace.auto_switch`'s own absence.
set("monitor.primary_layout", String("dynamic".into()));
set("monitor.secondary_layout", String("tiling".into()));
@@ -166,14 +169,15 @@ pub(super) fn default_config() -> HashMap<String, ConfigValue> {
// "this monitor's workspace count" describe a design that doesn't
// exist. `workspace.count` is the one knob that actually does anything.
- set("window.focus_follows_mouse", Bool(false));
- set("window.mouse_follows_focus", Bool(true));
- set("window.auto_raise", Bool(false));
- set("window.auto_focus", Bool(true));
- set("window.raise_on_focus", Bool(true));
- set("window.remember_position", Bool(true));
- set("window.remember_size", Bool(true));
- set("window.remember_state", Bool(true));
+ // The `window.*` namespace this codebase's own `docs/DEFAULTS.md`
+ // documented (focus_follows_mouse/mouse_follows_focus/auto_raise/
+ // auto_focus/raise_on_focus/remember_position/remember_size/
+ // remember_state) was a full, entirely unimplemented duplicate of
+ // `general.*`'s own focus keys plus three genuinely unbuilt
+ // per-app-window-state-persistence features - removed rather than
+ // seeded, same reasoning as everything else in this comment block.
+ // `general.focus_follows_mouse`/`general.auto_raise` above are the
+ // real, working versions of the one pair that *is* implemented.
set("workspace.count", Number(10.0));
set("workspace.names", List(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"].map(|s| s.to_string()).to_vec()));