diff --git a/src/shell/mod.rs b/src/shell/mod.rs index 8217ee60..5634f07b 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -772,7 +772,7 @@ impl Shell { self.update_active(seats) } - fn update_active<'a>(&self, seats: impl Iterator) { + fn update_active<'a>(&mut self, seats: impl Iterator) { // update activate status let focused_windows = seats .flat_map(|seat| { @@ -782,8 +782,22 @@ impl Shell { }) .collect::>(); - for output in self.outputs() { - let workspace = self.active_space(output); + for output in self.outputs.iter() { + let workspace = match &self.mode { + Mode::OutputBound => { + let active = output + .user_data() + .get::() + .unwrap() + .get() + .unwrap(); + &mut self.spaces[active] + } + Mode::Global { active } => &mut self.spaces[*active], + }; + for focused in focused_windows.iter() { + workspace.space.raise_window(focused, true); + } for window in workspace.space.windows() { window.set_activated(focused_windows.contains(window)); window.configure();