From 14d10e48637914666e0b2ae9aecb0a9be09d1b12 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Thu, 6 Jan 2022 18:29:30 +0100 Subject: [PATCH] space: `output_under` may return multiple outputs --- src/desktop/space/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/desktop/space/mod.rs b/src/desktop/space/mod.rs index 3889824..0565bf1 100644 --- a/src/desktop/space/mod.rs +++ b/src/desktop/space/mod.rs @@ -136,10 +136,10 @@ impl Space { }) } - /// Get a reference to the output under a given point, if any - pub fn output_under>>(&self, point: P) -> Option<&Output> { + /// Get a reference to the outputs under a given point + pub fn output_under>>(&self, point: P) -> impl Iterator { let point = point.into(); - self.outputs.iter().rev().find(|o| { + self.outputs.iter().rev().filter(move |o| { let bbox = self.output_geometry(o); bbox.map(|bbox| bbox.to_f64().contains(point)).unwrap_or(false) })