forge
Explore
Log in

Don't you dare go Hollow

Warp mouse to focus on window closing

Browse files at this commit

a55db6c6c4721c935dd93f59aec7d3eb35193d3bIvan MolodetskikhParent: a011b38
src/handlers/xdg_shell.rsmodified+8 -0
@@ -460,7 +460,15 @@ impl XdgShellHandler for State {
460460 return;
461461 };
462462
463+ let active_window = self.niri.layout.active_window().map(|(w, _)| w);
464+ let was_active = active_window == Some(&window);
465+
463466 self.niri.layout.remove_window(&window);
467+
468+ if was_active {
469+ self.maybe_warp_cursor_to_focus();
470+ }
471+
464472 self.niri.queue_redraw(output);
465473 }
466474