diff options
Diffstat (limited to 'crates/config/src/engine')
| -rw-r--r-- | crates/config/src/engine/general.rs | 18 | ||||
| -rw-r--r-- | crates/config/src/engine/support.rs | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/crates/config/src/engine/general.rs b/crates/config/src/engine/general.rs index c10ecf0..c8a136f 100644 --- a/crates/config/src/engine/general.rs +++ b/crates/config/src/engine/general.rs @@ -172,6 +172,23 @@ impl Engine { _ => None, } }; + // `min_width`/`min_height` - the smallest this window may be + // resized to, overriding whatever the client itself declared. + // Two plain numbers rather than a `"WxH"` string: unlike an + // aspect ratio, a size is not conventionally written as one + // token, and `width`/`height` above already set the precedent + // for separate keys. + let min_size: Option<(u32, u32)> = { + let min_width: Option<u32> = actions.get("min_width")?; + let min_height: Option<u32> = actions.get("min_height")?; + match (min_width, min_height) { + (None, None) => None, + // One alone is meaningful - a terminal that needs + // width but no particular height, say. The unset axis + // keeps the global floor. + (w, h) => Some((w.unwrap_or(srdwm_core::MIN_WINDOW_WIDTH), h.unwrap_or(srdwm_core::MIN_WINDOW_HEIGHT))), + } + }; // `aspect_ratio = "9:16"` - the "phone monitor / special // workspace" ask's own real, scoped answer (see `Window:: // aspect_ratio`'s own doc comment in `crates/core`): a rule @@ -210,6 +227,7 @@ impl Engine { opacity: actions.get("opacity")?, resize_margin: actions.get("resize_margin")?, aspect_ratio, + min_size, }, }; state.borrow().wm.borrow_mut().add_rule(rule); diff --git a/crates/config/src/engine/support.rs b/crates/config/src/engine/support.rs index a2423d2..76bcf5e 100644 --- a/crates/config/src/engine/support.rs +++ b/crates/config/src/engine/support.rs @@ -182,6 +182,9 @@ pub(super) fn default_config() -> HashMap<String, ConfigValue> { // Re-read `init.lua` when it changes on disk, no reload key needed. // See `main.rs`'s `config_mtime`/`CONFIG_POLL_INTERVAL`. set("general.config_reload_on_write", Bool(true)); + // Maximize runs to the bottom of the screen, under a dock, rather than + // stopping above it. A top bar is still always honoured. + set("general.maximize_covers_dock", Bool(true)); set("general.smart_placement", Bool(true)); set("general.window_gap", Number(8.0)); set("general.animations", Bool(true)); |