( &self, point: P, )
| 237 | } |
| 238 | |
| 239 | pub fn window_under<P: Into<Point<f64, Logical>>>( |
| 240 | &self, |
| 241 | point: P, |
| 242 | ) -> Option<(Ref<'_, Window>, Point<i32, Logical>)> { |
| 243 | let point = point.into(); |
| 244 | self.windows.iter().filter(|e| e.borrow().bbox().to_f64().contains(point)).find_map(|e| { |
| 245 | // we need to offset the point to the location where the surface is actually drawn |
| 246 | let render_location = e.borrow().render_location(); |
| 247 | if e.borrow().smithay_window.is_in_input_region(&(point - render_location.to_f64())) { |
| 248 | Some((Ref::map(e.borrow(), |hw| &hw.smithay_window), render_location)) |
| 249 | } else { |
| 250 | None |
| 251 | } |
| 252 | }) |
| 253 | } |
| 254 | |
| 255 | pub fn contains_window(&self, window: &Window) -> bool { |
| 256 | self.windows.iter().any(|w| &w.borrow().smithay_window == window) |
no test coverage detected