diff options
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/mod.rs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 9347fc73..040a5cb4 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -2272,6 +2272,23 @@ impl<W: LayoutElement> Layout<W> { mon.active_window().map(|win| (win, &mon.output)) } + pub fn interactive_moved_window_under( + &self, + output: &Output, + pos_within_output: Point<f64, Logical>, + ) -> Option<(&W, HitType)> { + if let Some(InteractiveMoveState::Moving(move_)) = &self.interactive_move { + if move_.output == *output { + let tile_pos = move_.tile_render_location(1.); + HitType::hit_tile(&move_.tile, tile_pos, pos_within_output) + } else { + None + } + } else { + None + } + } + /// Returns the window under the cursor and the hit type. pub fn window_under( &self, @@ -2282,11 +2299,6 @@ impl<W: LayoutElement> Layout<W> { return None; }; - if let Some(InteractiveMoveState::Moving(move_)) = &self.interactive_move { - let tile_pos = move_.tile_render_location(); - return HitType::hit_tile(&move_.tile, tile_pos, pos_within_output); - }; - let mon = monitors.iter().find(|mon| &mon.output == output)?; mon.window_under(pos_within_output) } |
