From 379466fe866f006700df9ace16c12ad78adb9a83 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Tue, 4 Feb 2025 23:56:00 +0200 Subject: Fix layer-surface hit-testing giving up after the topmost bbox match fails layer_surface_under_layers used smithay's LayerMap::layer_under(), which returns only the single topmost surface (by z-order) whose *bounding box* contains the point - not its real input region. If that one surface's input region excluded the point, the old code gave up on the whole layer-kind instead of falling through to whatever real surface is stacked underneath it. Concretely: any other surface on the same layer-kind with a bbox overlapping the target - a mapped-but-mostly-transparent backdrop/dismiss popup, concretely - would silently swallow every hover and click meant for whatever's underneath, with no way to reach it at all. Same failure shape as an already-fixed AGS-side bug (Overview's own bbox-wide input-region fallback), just compositor-side and not limited to that one instance. Now walks every candidate on a layer-kind topmost-first and tries the next one down when a candidate's actual input region doesn't cover the point, instead of stopping at the first bounding-box match. --- crates/wayland/src/input.rs | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/wayland/src/input.rs b/crates/wayland/src/input.rs index fcffc19..f737957 100644 --- a/crates/wayland/src/input.rs +++ b/crates/wayland/src/input.rs @@ -67,10 +67,31 @@ pub(crate) fn layer_surface_under_layers(state: &CompState, pos: Point