diff --git a/compositor/src/input.rs b/compositor/src/input.rs index 12d83b8..c69ccde 100644 --- a/compositor/src/input.rs +++ b/compositor/src/input.rs @@ -624,6 +624,9 @@ impl Ferese { { return; } + if self.layer_under(position).is_some() { + return; + } let Some(window) = self.window_under_visual(position) else { return; diff --git a/compositor/src/state.rs b/compositor/src/state.rs index 947ce56..ae0f30e 100644 --- a/compositor/src/state.rs +++ b/compositor/src/state.rs @@ -862,11 +862,23 @@ impl Ferese { let visual = self.presented_window_rect(*id)?; let caption_height = if overview_active { 34.0 } else { 0.0 }; - (position.x >= visual.x + let inside_visual = position.x >= visual.x && position.y >= visual.y && position.x < visual.x + visual.width - && position.y < visual.y + visual.height + caption_height) - .then_some(window.clone()) + && position.y < visual.y + visual.height + caption_height; + if !inside_visual { + return None; + } + + if !overview_active { + let (source_x, source_y) = + self.inverse_presented_window_point(*id, position.x, position.y)?; + let source_point = + Point::from((source_x, source_y)) + window.geometry().loc.to_f64(); + window.surface_under(source_point, WindowSurfaceType::ALL)?; + } + + Some(window.clone()) }; if overview_active {