input: Implement focus switched on tiling layout

This commit is contained in:
Victoria Brekenfeld 2022-03-30 23:08:35 +02:00
parent f7ac9654d1
commit 69c71179d4
7 changed files with 336 additions and 166 deletions

View file

@ -409,6 +409,22 @@ impl Shell {
.update_orientation(seat, orientation)
}
pub fn move_focus<'a>(
&mut self,
seat: &Seat,
output: &Output,
focus: layout::FocusDirection,
seats: impl Iterator<Item = &'a Seat>,
) {
if let Some(surface) = self
.active_space_mut(output)
.move_focus(seat, focus)
.and_then(|window| window.toplevel().get_surface().cloned())
{
self.set_focus(Some(&surface), seat, seats, None)
}
}
fn set_focus<'a>(
&mut self,
surface: Option<&WlSurface>,