diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index e69de29b..00000000 diff --git a/src/input/mod.rs b/src/input/mod.rs index b6b6b6c2..cc171df1 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -676,7 +676,10 @@ impl State { 0 => 9, x => x - 1, }; - Shell::activate_and_focus(self, seat, ¤t_output, workspace as usize) + let _ = self + .common + .shell + .activate(¤t_output, workspace as usize); } Action::NextWorkspace => { let current_output = seat.active_output(); @@ -687,7 +690,7 @@ impl State { .active_num(¤t_output) .saturating_add(1); // TODO: Possibly move to next output, if idx to large - Shell::activate_and_focus(self, seat, ¤t_output, workspace) + let _ = self.common.shell.activate(¤t_output, workspace); } Action::PreviousWorkspace => { let current_output = seat.active_output(); @@ -698,7 +701,7 @@ impl State { .active_num(¤t_output) .saturating_sub(1); // TODO: Possibly move to prev output, if idx < 0 - Shell::activate_and_focus(self, seat, ¤t_output, workspace) + let _ = self.common.shell.activate(¤t_output, workspace); } Action::LastWorkspace => { let current_output = seat.active_output(); @@ -708,7 +711,7 @@ impl State { .workspaces .len(¤t_output) .saturating_sub(1); - Shell::activate_and_focus(self, seat, ¤t_output, workspace) + let _ = self.common.shell.activate(¤t_output, workspace); } x @ Action::MoveToWorkspace(_) | x @ Action::SendToWorkspace(_) => { let current_output = seat.active_output(); diff --git a/src/shell/mod.rs b/src/shell/mod.rs index eb12a3d6..0ff4b8e6 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -1176,19 +1176,6 @@ impl Shell { } } - pub fn activate_and_focus(state: &mut State, seat: &Seat, output: &Output, idx: usize) { - let _ = state.common.shell.activate(output, idx); - - // without this the last window of the target workspace may not receive focus when switching - // from a workspace having focused fullscreen window (there may be other cases). - let workspace = state.common.shell.active_space(output); - if let Some(mapped) = workspace.focus_stack.get(seat).last() { - // TODO: There should probably be a `KeyboardFocusTargetRef<'a>` to avoid unnecessary - // cloning. - Common::set_focus(state, Some(&(mapped.clone().into())), seat, None); - } - } - pub fn move_current_window( state: &mut State, seat: &Seat,