Update focus in one place
Browse files at this commit8cdd37b9932eb4acd8e983af53d0ba7bb04a3e64Parent: e89966e4 changed files +1 -17
- src/handlers/compositor.rs +0 -4
- src/handlers/xdg_shell.rs +0 -1
- src/input.rs +0 -12
- src/main.rs +1 -0
src/handlers/compositor.rsmodified+0 -4
| @@ -55,8 +55,6 @@ impl CompositorHandler for Niri { | |||
| 55 | 55 | ||
| 56 | let output = self.monitor_set.active_output().unwrap().clone(); | 56 | let output = self.monitor_set.active_output().unwrap().clone(); |
| 57 | self.monitor_set.add_window_to_output(&output, window, true); | 57 | self.monitor_set.add_window_to_output(&output, window, true); |
| 58 | - self.update_focus(); | ||
| 59 | - | ||
| 60 | self.queue_redraw(output); | 58 | self.queue_redraw(output); |
| 61 | return; | 59 | return; |
| 62 | } | 60 | } |
| @@ -80,8 +78,6 @@ impl CompositorHandler for Niri { | |||
| 80 | // The toplevel got unmapped. | 78 | // The toplevel got unmapped. |
| 81 | self.monitor_set.remove_window(&window); | 79 | self.monitor_set.remove_window(&window); |
| 82 | self.unmapped_windows.insert(surface.clone(), window); | 80 | self.unmapped_windows.insert(surface.clone(), window); |
| 83 | - self.update_focus(); | ||
| 84 | - | ||
| 85 | self.queue_redraw(output); | 81 | self.queue_redraw(output); |
| 86 | return; | 82 | return; |
| 87 | } | 83 | } |
src/handlers/xdg_shell.rsmodified+0 -1
| @@ -241,7 +241,6 @@ impl XdgShellHandler for Niri { | |||
| 241 | .find_window_and_output(surface.wl_surface()) | 241 | .find_window_and_output(surface.wl_surface()) |
| 242 | .unwrap(); | 242 | .unwrap(); |
| 243 | self.monitor_set.remove_window(&window); | 243 | self.monitor_set.remove_window(&window); |
| 244 | - self.update_focus(); | ||
| 245 | self.queue_redraw(output); | 244 | self.queue_redraw(output); |
| 246 | } | 245 | } |
| 247 | 246 | ||
src/input.rsmodified+0 -12
| @@ -179,53 +179,43 @@ impl Niri { | |||
| 179 | } | 179 | } |
| 180 | Action::FocusLeft => { | 180 | Action::FocusLeft => { |
| 181 | self.monitor_set.focus_left(); | 181 | self.monitor_set.focus_left(); |
| 182 | - self.update_focus(); | ||
| 183 | } | 182 | } |
| 184 | Action::FocusRight => { | 183 | Action::FocusRight => { |
| 185 | self.monitor_set.focus_right(); | 184 | self.monitor_set.focus_right(); |
| 186 | - self.update_focus(); | ||
| 187 | } | 185 | } |
| 188 | Action::FocusDown => { | 186 | Action::FocusDown => { |
| 189 | self.monitor_set.focus_down(); | 187 | self.monitor_set.focus_down(); |
| 190 | - self.update_focus(); | ||
| 191 | } | 188 | } |
| 192 | Action::FocusUp => { | 189 | Action::FocusUp => { |
| 193 | self.monitor_set.focus_up(); | 190 | self.monitor_set.focus_up(); |
| 194 | - self.update_focus(); | ||
| 195 | } | 191 | } |
| 196 | Action::MoveToWorkspaceDown => { | 192 | Action::MoveToWorkspaceDown => { |
| 197 | self.monitor_set.move_to_workspace_down(); | 193 | self.monitor_set.move_to_workspace_down(); |
| 198 | - self.update_focus(); | ||
| 199 | // FIXME: granular | 194 | // FIXME: granular |
| 200 | self.queue_redraw_all(); | 195 | self.queue_redraw_all(); |
| 201 | } | 196 | } |
| 202 | Action::MoveToWorkspaceUp => { | 197 | Action::MoveToWorkspaceUp => { |
| 203 | self.monitor_set.move_to_workspace_up(); | 198 | self.monitor_set.move_to_workspace_up(); |
| 204 | - self.update_focus(); | ||
| 205 | // FIXME: granular | 199 | // FIXME: granular |
| 206 | self.queue_redraw_all(); | 200 | self.queue_redraw_all(); |
| 207 | } | 201 | } |
| 208 | Action::SwitchWorkspaceDown => { | 202 | Action::SwitchWorkspaceDown => { |
| 209 | self.monitor_set.switch_workspace_down(); | 203 | self.monitor_set.switch_workspace_down(); |
| 210 | - self.update_focus(); | ||
| 211 | // FIXME: granular | 204 | // FIXME: granular |
| 212 | self.queue_redraw_all(); | 205 | self.queue_redraw_all(); |
| 213 | } | 206 | } |
| 214 | Action::SwitchWorkspaceUp => { | 207 | Action::SwitchWorkspaceUp => { |
| 215 | self.monitor_set.switch_workspace_up(); | 208 | self.monitor_set.switch_workspace_up(); |
| 216 | - self.update_focus(); | ||
| 217 | // FIXME: granular | 209 | // FIXME: granular |
| 218 | self.queue_redraw_all(); | 210 | self.queue_redraw_all(); |
| 219 | } | 211 | } |
| 220 | Action::ConsumeIntoColumn => { | 212 | Action::ConsumeIntoColumn => { |
| 221 | self.monitor_set.consume_into_column(); | 213 | self.monitor_set.consume_into_column(); |
| 222 | - self.update_focus(); | ||
| 223 | // FIXME: granular | 214 | // FIXME: granular |
| 224 | self.queue_redraw_all(); | 215 | self.queue_redraw_all(); |
| 225 | } | 216 | } |
| 226 | Action::ExpelFromColumn => { | 217 | Action::ExpelFromColumn => { |
| 227 | self.monitor_set.expel_from_column(); | 218 | self.monitor_set.expel_from_column(); |
| 228 | - self.update_focus(); | ||
| 229 | // FIXME: granular | 219 | // FIXME: granular |
| 230 | self.queue_redraw_all(); | 220 | self.queue_redraw_all(); |
| 231 | } | 221 | } |
| @@ -333,8 +323,6 @@ impl Niri { | |||
| 333 | let output = self.output_under_cursor().unwrap(); | 323 | let output = self.output_under_cursor().unwrap(); |
| 334 | self.monitor_set.activate_output(&output); | 324 | self.monitor_set.activate_output(&output); |
| 335 | } | 325 | } |
| 336 | - | ||
| 337 | - self.update_focus(); | ||
| 338 | }; | 326 | }; |
| 339 | 327 | ||
| 340 | pointer.button( | 328 | pointer.button( |
src/main.rsmodified+1 -0
| @@ -114,6 +114,7 @@ fn main() { | |||
| 114 | // These should be called periodically, before flushing the clients. | 114 | // These should be called periodically, before flushing the clients. |
| 115 | data.niri.monitor_set.refresh(); | 115 | data.niri.monitor_set.refresh(); |
| 116 | data.niri.popups.cleanup(); | 116 | data.niri.popups.cleanup(); |
| 117 | + data.niri.update_focus(); | ||
| 117 | 118 | ||
| 118 | { | 119 | { |
| 119 | let _span = tracy_client::span!("flush_clients"); | 120 | let _span = tracy_client::span!("flush_clients"); |