mirror of
https://github.com/outbackdingo/hyprcosmic.git
synced 2026-08-25 14:53:21 +00:00
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:
@@ -45,6 +45,7 @@ $gap = 4
|
|||||||
|
|
||||||
general {
|
general {
|
||||||
autotile = true
|
autotile = true
|
||||||
|
preserve_split = true
|
||||||
gaps_in = $gap
|
gaps_in = $gap
|
||||||
gaps_out = $gap * 2
|
gaps_out = $gap * 2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,6 +161,17 @@ pub const REGISTRY: &[Entry] = &[
|
|||||||
validate: None,
|
validate: None,
|
||||||
doc: "Automatically tile new windows",
|
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 {
|
Entry {
|
||||||
conf: "general.active_hint",
|
conf: "general.active_hint",
|
||||||
targets: &[Target::Direct {
|
targets: &[Target::Direct {
|
||||||
@@ -359,6 +370,18 @@ mod tests {
|
|||||||
assert_eq!(e.targets[0].component(), "com.system76.CosmicComp");
|
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]
|
#[test]
|
||||||
fn every_entry_has_at_least_one_target() {
|
fn every_entry_has_at_least_one_target() {
|
||||||
for e in REGISTRY {
|
for e in REGISTRY {
|
||||||
|
|||||||
Reference in New Issue
Block a user