diff options
| -rw-r--r-- | niri-config/src/lib.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index d5d45650..fc1fdfd4 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -1589,8 +1589,15 @@ impl Default for Config { impl BorderRule { pub fn merge_with(&mut self, other: &Self) { - self.off |= other.off; - self.on |= other.on; + if other.off { + self.off = true; + self.on = false; + } + + if other.on { + self.off = false; + self.on = true; + } if let Some(x) = other.width { self.width = Some(x); @@ -3900,12 +3907,12 @@ mod tests { assert_snapshot!(is_on("off", &["off", "off"]), @"off"); assert_snapshot!(is_on("off", &["off", "on"]), @"on"); - assert_snapshot!(is_on("off", &["on", "off"]), @"on"); + assert_snapshot!(is_on("off", &["on", "off"]), @"off"); assert_snapshot!(is_on("off", &["on", "on"]), @"on"); assert_snapshot!(is_on("on", &["off", "off"]), @"off"); assert_snapshot!(is_on("on", &["off", "on"]), @"on"); - assert_snapshot!(is_on("on", &["on", "off"]), @"on"); + assert_snapshot!(is_on("on", &["on", "off"]), @"off"); assert_snapshot!(is_on("on", &["on", "on"]), @"on"); } } |
