seat: Workaround old active outputs on hotplug

This commit is contained in:
Victoria Brekenfeld 2022-11-22 10:07:17 +01:00
parent 9c41c80345
commit b2686424ea
9 changed files with 69 additions and 14 deletions

View file

@ -448,7 +448,15 @@ impl Shell {
}
}
pub fn remove_output(&mut self, output: &Output) {
pub fn remove_output(&mut self, output: &Output, seats: impl Iterator<Item = Seat<State>>) {
if let Some(first_output) = self.outputs.get(0) {
for seat in seats {
if &seat.active_output() == output {
seat.set_active_output(first_output);
}
}
}
if !self.outputs.contains(output) {
return;
}