diff options
| author | srdusr <[email protected]> | 2024-08-09 09:36:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2024-08-09 09:36:00 +0200 |
| commit | 31de54096243fb000fa6e7008a914861293482a5 (patch) | |
| tree | 13ec4c5ae351994f35c90180e07988b5dffdb3f5 | |
| parent | 52b0b8927fa56f42ad6b39fb45bbed5a2d392dce (diff) | |
| download | srdwm-31de54096243fb000fa6e7008a914861293482a5.tar.gz srdwm-31de54096243fb000fa6e7008a914861293482a5.zip | |
Fix a misleading workspace comment and drop four dead config keys
visible_windows' doc comment claimed windows show "on the active
workspace of whichever monitor they're assigned to" - the code never
reads w.monitor at all; current_workspace is one flat value shared by
every monitor, not per-output. Documented that explicitly on both the
field and the method, since this is a real behavioral difference from
Hyprland worth a reader actually seeing, not just an inaccurate comment
to fix quietly.
monitor.primary_workspace/monitor.workspace_count describe a per-
monitor-workspace design that doesn't exist; workspace.auto_switch/
workspace.persistent were never wired to any behavior. All four were
seeded into default_config() and documented in DEFAULTS.md, so
srd.set()/srd.get() on them silently succeeded while doing nothing --
removed from both, matching the precedent already set by general.
rounded_corners' deliberate absence from default_config for a
different reason (backend-dependent default rather than unbuilt).
| -rw-r--r-- | crates/config/src/engine/support.rs | 17 | ||||
| -rw-r--r-- | crates/core/src/manager/mod.rs | 5 | ||||
| -rw-r--r-- | crates/core/src/manager/workspaces.rs | 7 | ||||
| -rw-r--r-- | docs/DEFAULTS.md | 10 |
4 files changed, 30 insertions, 9 deletions
diff --git a/crates/config/src/engine/support.rs b/crates/config/src/engine/support.rs index 160e27a..7b42f53 100644 --- a/crates/config/src/engine/support.rs +++ b/crates/config/src/engine/support.rs @@ -159,8 +159,12 @@ pub(super) fn default_config() -> HashMap<String, ConfigValue> { set("monitor.primary_layout", String("dynamic".into())); set("monitor.secondary_layout", String("tiling".into())); set("monitor.auto_detect", Bool(true)); - set("monitor.primary_workspace", Number(1.0)); - set("monitor.workspace_count", Number(10.0)); + // Deliberately *not* seeded, unlike everything else here: srdwm has one + // flat workspace list shared by every monitor (see WindowManager's + // `current_workspace` doc comment), not Hyprland-style independent + // per-monitor workspace sets - "this monitor's primary workspace" and + // "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)); @@ -173,8 +177,13 @@ pub(super) fn default_config() -> HashMap<String, ConfigValue> { 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())); - set("workspace.auto_switch", Bool(false)); - set("workspace.persistent", Bool(true)); + // `auto_switch` (jump to a new window's workspace when a rule places it + // elsewhere) and `persistent` (workspace state surviving a restart) are + // deliberately *not* seeded here: neither is implemented, and a key + // that's accepted and silently does nothing is worse than one that + // doesn't exist - see the same reasoning on `general.rounded_corners`' + // absence from this function, though that one differs by backend + // rather than being simply unbuilt. set("workspace.auto_back_and_forth", Bool(false)); set("performance.vsync", Bool(true)); diff --git a/crates/core/src/manager/mod.rs b/crates/core/src/manager/mod.rs index 91df887..609b87f 100644 --- a/crates/core/src/manager/mod.rs +++ b/crates/core/src/manager/mod.rs @@ -41,6 +41,11 @@ pub struct WindowManager { focused: Option<WindowId>, monitors: Vec<Monitor>, workspaces: Vec<Workspace>, + /// One flat value shared by every monitor - not per-output. Unlike + /// Hyprland, srdwm has no notion of an independent workspace set per + /// monitor; switching workspace changes what's visible on every screen + /// at once. See `visible_windows`'s doc comment for the filter this + /// actually drives. current_workspace: WorkspaceId, /// Whichever workspace was current immediately before the current one /// became current - see `switch_workspace`'s doc comment. diff --git a/crates/core/src/manager/workspaces.rs b/crates/core/src/manager/workspaces.rs index 485ced0..6ffb21b 100644 --- a/crates/core/src/manager/workspaces.rs +++ b/crates/core/src/manager/workspaces.rs @@ -75,7 +75,12 @@ impl WindowManager { } /// Windows that should currently be shown to the user: those on the - /// active workspace of whichever monitor they're assigned to, and not minimized. + /// current workspace, and not minimized. + /// + /// `current_workspace` is a single value shared by every monitor -- + /// srdwm does not have Hyprland-style independent per-monitor + /// workspaces, so switching workspace changes what's shown on every + /// screen at once. `w.monitor` plays no part in this filter at all. pub fn visible_windows(&self) -> impl Iterator<Item = &Window> { self.windows.values().filter(|w| w.workspace == self.current_workspace && !w.minimized) } diff --git a/docs/DEFAULTS.md b/docs/DEFAULTS.md index 373ac2e..b5bf947 100644 --- a/docs/DEFAULTS.md +++ b/docs/DEFAULTS.md @@ -27,9 +27,11 @@ srd.set("general.auto_focus", true) -- Default: true srd.set("monitor.primary_layout", "dynamic") -- Default: "dynamic" srd.set("monitor.secondary_layout", "tiling") -- Default: "tiling" srd.set("monitor.auto_detect", true) -- Default: true -srd.set("monitor.primary_workspace", 1) -- Default: 1 -srd.set("monitor.workspace_count", 10) -- Default: 10 ``` +srdwm has one flat workspace list shared by every monitor, not an +independent set per monitor - there is no "this monitor's primary +workspace"/"this monitor's workspace count" to configure. `workspace.count` +below is the actual knob. ### Window Behavior (`window.*`) ```lua @@ -47,10 +49,10 @@ srd.set("window.remember_state", true) -- Default: true ```lua srd.set("workspace.count", 10) -- Default: 10 srd.set("workspace.names", {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}) -srd.set("workspace.auto_switch", false) -- Default: false -srd.set("workspace.persistent", true) -- Default: true srd.set("workspace.auto_back_and_forth", false) -- Default: false ``` +(`workspace.auto_switch`/`workspace.persistent` are not implemented - not +listed here since setting either currently does nothing.) ### Performance Settings (`performance.*`) ```lua |