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();