diff --git a/packages/wm/src/common/events/handle_window_moved_or_resized_end.rs b/packages/wm/src/common/events/handle_window_moved_or_resized_end.rs index ee482662..cb5f73c6 100644 --- a/packages/wm/src/common/events/handle_window_moved_or_resized_end.rs +++ b/packages/wm/src/common/events/handle_window_moved_or_resized_end.rs @@ -107,7 +107,7 @@ fn drop_as_tiling_window( // Get the workspace, split containers, and other windows under the // dragged window. let containers_at_pos = state - .containers_at_point(&mouse_pos) + .containers_at_point(workspace.clone().into(), &mouse_pos) .into_iter() .filter(|container| container.id() != moved_window.id()); diff --git a/packages/wm/src/wm_state.rs b/packages/wm/src/wm_state.rs index 85e0a0f9..9e8f7562 100644 --- a/packages/wm/src/wm_state.rs +++ b/packages/wm/src/wm_state.rs @@ -502,9 +502,12 @@ impl WmState { .or(Some(workspace.into())) } - pub fn containers_at_point(&self, point: &Point) -> Vec { - self - .root_container + pub fn containers_at_point( + &self, + origin_container: Container, + point: &Point, + ) -> Vec { + origin_container .descendants() .filter(|descendant| { descendant