forge
Explore
Log in

Don't you dare go Hollow

Update focus in one place

Browse files at this commit

8cdd37b9932eb4acd8e983af53d0ba7bb04a3e64Ivan MolodetskikhParent: e89966e
src/handlers/compositor.rsmodified+0 -4
@@ -55,8 +55,6 @@ impl CompositorHandler for Niri {
5555
5656 let output = self.monitor_set.active_output().unwrap().clone();
5757 self.monitor_set.add_window_to_output(&output, window, true);
58- self.update_focus();
59-
6058 self.queue_redraw(output);
6159 return;
6260 }
@@ -80,8 +78,6 @@ impl CompositorHandler for Niri {
8078 // The toplevel got unmapped.
8179 self.monitor_set.remove_window(&window);
8280 self.unmapped_windows.insert(surface.clone(), window);
83- self.update_focus();
84-
8581 self.queue_redraw(output);
8682 return;
8783 }
src/handlers/xdg_shell.rsmodified+0 -1
@@ -241,7 +241,6 @@ impl XdgShellHandler for Niri {
241241 .find_window_and_output(surface.wl_surface())
242242 .unwrap();
243243 self.monitor_set.remove_window(&window);
244- self.update_focus();
245244 self.queue_redraw(output);
246245 }
247246
src/input.rsmodified+0 -12
@@ -179,53 +179,43 @@ impl Niri {
179179 }
180180 Action::FocusLeft => {
181181 self.monitor_set.focus_left();
182- self.update_focus();
183182 }
184183 Action::FocusRight => {
185184 self.monitor_set.focus_right();
186- self.update_focus();
187185 }
188186 Action::FocusDown => {
189187 self.monitor_set.focus_down();
190- self.update_focus();
191188 }
192189 Action::FocusUp => {
193190 self.monitor_set.focus_up();
194- self.update_focus();
195191 }
196192 Action::MoveToWorkspaceDown => {
197193 self.monitor_set.move_to_workspace_down();
198- self.update_focus();
199194 // FIXME: granular
200195 self.queue_redraw_all();
201196 }
202197 Action::MoveToWorkspaceUp => {
203198 self.monitor_set.move_to_workspace_up();
204- self.update_focus();
205199 // FIXME: granular
206200 self.queue_redraw_all();
207201 }
208202 Action::SwitchWorkspaceDown => {
209203 self.monitor_set.switch_workspace_down();
210- self.update_focus();
211204 // FIXME: granular
212205 self.queue_redraw_all();
213206 }
214207 Action::SwitchWorkspaceUp => {
215208 self.monitor_set.switch_workspace_up();
216- self.update_focus();
217209 // FIXME: granular
218210 self.queue_redraw_all();
219211 }
220212 Action::ConsumeIntoColumn => {
221213 self.monitor_set.consume_into_column();
222- self.update_focus();
223214 // FIXME: granular
224215 self.queue_redraw_all();
225216 }
226217 Action::ExpelFromColumn => {
227218 self.monitor_set.expel_from_column();
228- self.update_focus();
229219 // FIXME: granular
230220 self.queue_redraw_all();
231221 }
@@ -333,8 +323,6 @@ impl Niri {
333323 let output = self.output_under_cursor().unwrap();
334324 self.monitor_set.activate_output(&output);
335325 }
336-
337- self.update_focus();
338326 };
339327
340328 pointer.button(
src/main.rsmodified+1 -0
@@ -114,6 +114,7 @@ fn main() {
114114 // These should be called periodically, before flushing the clients.
115115 data.niri.monitor_set.refresh();
116116 data.niri.popups.cleanup();
117+ data.niri.update_focus();
117118
118119 {
119120 let _span = tracy_client::span!("flush_clients");