Warp mouse to focus on window closing
Browse files at this commita55db6c6c4721c935dd93f59aec7d3eb35193d3bParent: a011b381 changed file +8 -0
src/handlers/xdg_shell.rsmodified+8 -0
| @@ -460,7 +460,15 @@ impl XdgShellHandler for State { | ||
| 460 | 460 | return; |
| 461 | 461 | }; |
| 462 | 462 | |
| 463 | + let active_window = self.niri.layout.active_window().map(|(w, _)| w); | |
| 464 | + let was_active = active_window == Some(&window); | |
| 465 | + | |
| 463 | 466 | self.niri.layout.remove_window(&window); |
| 467 | + | |
| 468 | + if was_active { | |
| 469 | + self.maybe_warp_cursor_to_focus(); | |
| 470 | + } | |
| 471 | + | |
| 464 | 472 | self.niri.queue_redraw(output); |
| 465 | 473 | } |
| 466 | 474 |