forge
Explore
Log in

Don't you dare go Hollow

Warp mouse to focus on new window appearing

Browse files at this commit

a011b385d87db2eb8ecbff2ca2bfb7862e8267dfIvan MolodetskikhParent: 2984722
src/handlers/compositor.rsmodified+7 -0
@@ -143,6 +143,7 @@ impl CompositorHandler for State {
143143 })
144144 .map(|(window, _)| window.clone());
145145
146+ let window = window.clone();
146147 let win = window.clone();
147148
148149 let output = if let Some(p) = parent {
@@ -161,6 +162,12 @@ impl CompositorHandler for State {
161162
162163 if let Some(output) = output.cloned() {
163164 self.niri.layout.start_open_animation_for_window(&window);
165+
166+ let new_active_window = self.niri.layout.active_window().map(|(w, _)| w);
167+ if new_active_window == Some(&window) {
168+ self.maybe_warp_cursor_to_focus();
169+ }
170+
164171 self.niri.queue_redraw(output);
165172 }
166173 return;