From 178dfbec1aa695f9ee843cc001d40da3c112da9d Mon Sep 17 00:00:00 2001 From: dingo Date: Mon, 10 Aug 2026 14:53:27 +0700 Subject: [PATCH] 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. --- config/cosmic.conf | 1 + cosmic-conf/src/schema.rs | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/config/cosmic.conf b/config/cosmic.conf index b73fc95..0d09238 100644 --- a/config/cosmic.conf +++ b/config/cosmic.conf @@ -45,6 +45,7 @@ $gap = 4 general { autotile = true + preserve_split = true gaps_in = $gap gaps_out = $gap * 2 } diff --git a/cosmic-conf/src/schema.rs b/cosmic-conf/src/schema.rs index 129c46b..3135798 100644 --- a/cosmic-conf/src/schema.rs +++ b/cosmic-conf/src/schema.rs @@ -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 {