Add missing mouse warp to commit unmap
Browse files at this commit956bf7c0a84d2c5d618358b8577f361b275bf71aParent: 209492e1 changed file +9 -0
src/handlers/compositor.rsmodified+9 -0
| @@ -199,8 +199,17 @@ impl CompositorHandler for State { | |||
| 199 | 199 | ||
| 200 | if !is_mapped { | 200 | if !is_mapped { |
| 201 | // The toplevel got unmapped. | 201 | // The toplevel got unmapped. |
| 202 | + // | ||
| 203 | + // Test client: wleird-unmap. | ||
| 204 | + let active_window = self.niri.layout.active_window().map(|(m, _)| &m.window); | ||
| 205 | + let was_active = active_window == Some(&window); | ||
| 206 | + | ||
| 202 | self.niri.layout.remove_window(&window); | 207 | self.niri.layout.remove_window(&window); |
| 203 | 208 | ||
| 209 | + if was_active { | ||
| 210 | + self.maybe_warp_cursor_to_focus(); | ||
| 211 | + } | ||
| 212 | + | ||
| 204 | // Newly-unmapped toplevels must perform the initial commit-configure sequence | 213 | // Newly-unmapped toplevels must perform the initial commit-configure sequence |
| 205 | // afresh. | 214 | // afresh. |
| 206 | let unmapped = Unmapped::new(window); | 215 | let unmapped = Unmapped::new(window); |