diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-15 12:03:10 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-15 12:03:10 +0400 |
| commit | 8cdd37b9932eb4acd8e983af53d0ba7bb04a3e64 (patch) | |
| tree | decbe27ed43dec953675d4083350b19a260e1db7 | |
| parent | e89966e1507ef6f10fb30e9973d3a742d10f96c0 (diff) | |
| download | niri-8cdd37b9932eb4acd8e983af53d0ba7bb04a3e64.tar.gz niri-8cdd37b9932eb4acd8e983af53d0ba7bb04a3e64.tar.bz2 niri-8cdd37b9932eb4acd8e983af53d0ba7bb04a3e64.zip | |
Update focus in one place
| -rw-r--r-- | src/handlers/compositor.rs | 4 | ||||
| -rw-r--r-- | src/handlers/xdg_shell.rs | 1 | ||||
| -rw-r--r-- | src/input.rs | 12 | ||||
| -rw-r--r-- | src/main.rs | 1 |
4 files changed, 1 insertions, 17 deletions
diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs index 7a8612e8..8b0f032b 100644 --- a/src/handlers/compositor.rs +++ b/src/handlers/compositor.rs @@ -55,8 +55,6 @@ impl CompositorHandler for Niri { let output = self.monitor_set.active_output().unwrap().clone(); self.monitor_set.add_window_to_output(&output, window, true); - self.update_focus(); - self.queue_redraw(output); return; } @@ -80,8 +78,6 @@ impl CompositorHandler for Niri { // The toplevel got unmapped. self.monitor_set.remove_window(&window); self.unmapped_windows.insert(surface.clone(), window); - self.update_focus(); - self.queue_redraw(output); return; } diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index 00413451..59d21693 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -241,7 +241,6 @@ impl XdgShellHandler for Niri { .find_window_and_output(surface.wl_surface()) .unwrap(); self.monitor_set.remove_window(&window); - self.update_focus(); self.queue_redraw(output); } diff --git a/src/input.rs b/src/input.rs index ec25b22c..d500c21e 100644 --- a/src/input.rs +++ b/src/input.rs @@ -179,53 +179,43 @@ impl Niri { } Action::FocusLeft => { self.monitor_set.focus_left(); - self.update_focus(); } Action::FocusRight => { self.monitor_set.focus_right(); - self.update_focus(); } Action::FocusDown => { self.monitor_set.focus_down(); - self.update_focus(); } Action::FocusUp => { self.monitor_set.focus_up(); - self.update_focus(); } Action::MoveToWorkspaceDown => { self.monitor_set.move_to_workspace_down(); - self.update_focus(); // FIXME: granular self.queue_redraw_all(); } Action::MoveToWorkspaceUp => { self.monitor_set.move_to_workspace_up(); - self.update_focus(); // FIXME: granular self.queue_redraw_all(); } Action::SwitchWorkspaceDown => { self.monitor_set.switch_workspace_down(); - self.update_focus(); // FIXME: granular self.queue_redraw_all(); } Action::SwitchWorkspaceUp => { self.monitor_set.switch_workspace_up(); - self.update_focus(); // FIXME: granular self.queue_redraw_all(); } Action::ConsumeIntoColumn => { self.monitor_set.consume_into_column(); - self.update_focus(); // FIXME: granular self.queue_redraw_all(); } Action::ExpelFromColumn => { self.monitor_set.expel_from_column(); - self.update_focus(); // FIXME: granular self.queue_redraw_all(); } @@ -333,8 +323,6 @@ impl Niri { let output = self.output_under_cursor().unwrap(); self.monitor_set.activate_output(&output); } - - self.update_focus(); }; pointer.button( diff --git a/src/main.rs b/src/main.rs index 0bc75103..c69a9e81 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,6 +114,7 @@ fn main() { // These should be called periodically, before flushing the clients. data.niri.monitor_set.refresh(); data.niri.popups.cleanup(); + data.niri.update_focus(); { let _span = tracy_client::span!("flush_clients"); |
