From 9bfa85efc9d6032746566afbea635a4d9718cb88 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 22 Jan 2020 06:58:41 +0300 Subject: [PATCH] anvil.window_map: add some comments --- anvil/src/window_map.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/anvil/src/window_map.rs b/anvil/src/window_map.rs index 53ec2f3..3f7dbe3 100644 --- a/anvil/src/window_map.rs +++ b/anvil/src/window_map.rs @@ -48,7 +48,8 @@ impl Window where R: Role + Role + Role + 'static, { - // Find the topmost surface under this point if any and the location of this surface + /// Finds the topmost surface under this point if any and returns it together with the location of this + /// surface. fn matching( &self, point: (f64, f64), @@ -109,6 +110,8 @@ where wl_surface, (base_x, base_y), |_, attributes, role, &(mut x, mut y)| { + // The input region is intersected with the surface size, so the surface size + // can serve as an approximation for the input bounding box. if let Some((w, h)) = get_size(attributes) { if let Ok(subdata) = Role::::data(role) { x += subdata.location.0; @@ -148,6 +151,7 @@ where pub struct WindowMap { ctoken: CompositorToken, windows: Vec>, + /// A function returning the surface size. get_size: F, }