diff options
Diffstat (limited to 'src/layout/floating.rs')
| -rw-r--r-- | src/layout/floating.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/layout/floating.rs b/src/layout/floating.rs index b908d920..15c99e87 100644 --- a/src/layout/floating.rs +++ b/src/layout/floating.rs @@ -833,6 +833,26 @@ impl<W: LayoutElement> FloatingSpace<W> { } } + pub fn focus_topmost(&mut self) { + let result = self + .tiles_with_offsets() + .min_by(|(_, pos_a), (_, pos_b)| f64::total_cmp(&pos_a.y, &pos_b.y)); + if let Some((tile, _)) = result { + let id = tile.window().id().clone(); + self.activate_window(&id); + } + } + + pub fn focus_bottommost(&mut self) { + let result = self + .tiles_with_offsets() + .max_by(|(_, pos_a), (_, pos_b)| f64::total_cmp(&pos_a.y, &pos_b.y)); + if let Some((tile, _)) = result { + let id = tile.window().id().clone(); + self.activate_window(&id); + } + } + fn move_to(&mut self, idx: usize, new_pos: Point<f64, Logical>, animate: bool) { if animate { self.move_and_animate(idx, new_pos); |
