shell/tiling: Fix segfault on detaching last output

This commit is contained in:
Victoria Brekenfeld 2022-11-08 13:57:42 +01:00
parent 38c0acb943
commit fcf39337a7
2 changed files with 2 additions and 2 deletions

View file

@ -1,2 +1,2 @@
[toolchain]
channel = "1.63"
channel = "1.65"

View file

@ -267,7 +267,7 @@ impl TilingLayout {
pub fn unmap_output(&mut self, output: &Output) {
if let Some(src) = self.trees.remove(output) {
// TODO: expects last remaining output
let (output, dst) = self.trees.iter_mut().next().unwrap();
let Some((output, dst)) = self.trees.iter_mut().next() else { return; };
let orientation = match output.output.geometry().size {
x if x.w >= x.h => Orientation::Horizontal,
_ => Orientation::Vertical,