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