From 422d099d431135c187eee44f37da8d13b9f2f491 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 25 Nov 2024 17:10:06 -0500 Subject: [PATCH] fix: overlap notify positions --- src/wayland/protocols/overlap_notify.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/wayland/protocols/overlap_notify.rs b/src/wayland/protocols/overlap_notify.rs index 540fb482..1517e613 100644 --- a/src/wayland/protocols/overlap_notify.rs +++ b/src/wayland/protocols/overlap_notify.rs @@ -94,14 +94,18 @@ impl OverlapNotifyState { if inner.has_active_notifications() { let mut new_snapshot = OverlapSnapshot::default(); - let layer_geo = layer_surface.bbox().as_local().to_global(&output); + let layer_geo = map + .layer_geometry(layer_surface) + .unwrap_or_default() + .as_local() + .to_global(&output); for window in state.toplevel_info_state().registered_toplevels() { if let Some(window_geo) = window.global_geometry() { if let Some(intersection) = layer_geo.intersection(window_geo) { - // relative to window location + // relative to layer location let region = Rectangle::from_loc_and_size( - intersection.loc - window_geo.loc, + intersection.loc - layer_geo.loc, intersection.size, ) .as_logical(); @@ -114,11 +118,15 @@ impl OverlapNotifyState { if other_surface.wl_surface().id() == layer_surface.wl_surface().id() { continue; } - let other_geo = other_surface.bbox().as_local().to_global(&output); + let other_geo = map + .layer_geometry(other_surface) + .unwrap_or_default() + .as_local() + .to_global(&output); if let Some(intersection) = layer_geo.intersection(other_geo) { - // relative to window location + // relative to layer location let region = Rectangle::from_loc_and_size( - intersection.loc - other_geo.loc, + intersection.loc - layer_geo.loc, intersection.size, ) .as_logical();