Expose preserve_split, and turn it on

`general.preserve_split` maps straight to the compositor key Patch C adds,
so opening a third window gives three panes in a row instead of quadrants.

Every other key under `general` exists upstream; this one is the fork's
own field on `CosmicCompConfig`. If a rebase ever loses that field the
compositor would ignore the key without saying anything, so the target is
pinned in a test of its own rather than left to the generic registry
checks.
This commit is contained in:
2026-08-10 14:53:27 +07:00
parent 563fdc7330
commit 178dfbec1a
2 changed files with 24 additions and 0 deletions
+1
View File
@@ -45,6 +45,7 @@ $gap = 4
general {
autotile = true
preserve_split = true
gaps_in = $gap
gaps_out = $gap * 2
}
+23
View File
@@ -161,6 +161,17 @@ pub const REGISTRY: &[Entry] = &[
validate: None,
doc: "Automatically tile new windows",
},
Entry {
conf: "general.preserve_split",
targets: &[Target::Direct {
component: COMP,
version: 1,
key: "preserve_split",
}],
ty: Ty::Bool,
validate: None,
doc: "Open new windows alongside the focused one instead of splitting it",
},
Entry {
conf: "general.active_hint",
targets: &[Target::Direct {
@@ -359,6 +370,18 @@ mod tests {
assert_eq!(e.targets[0].component(), "com.system76.CosmicComp");
}
#[test]
fn preserve_split_targets_the_forks_own_comp_key() {
// Unlike every other `general` key this one does not exist upstream --
// it is a field this fork adds to `CosmicCompConfig`. If a rebase ever
// drops that field the compositor silently ignores the key, so pin the
// exact target here rather than trusting the generic registry checks.
let e = lookup("general.preserve_split").unwrap();
assert_eq!(e.targets.len(), 1);
assert_eq!(e.targets[0].component(), "com.system76.CosmicComp");
assert!(matches!(e.ty, Ty::Bool));
}
#[test]
fn every_entry_has_at_least_one_target() {
for e in REGISTRY {