forge
Explore
Log in

Don't you dare go Hollow

winit: Don't remove output on CloseRequested

Browse files at this commit

64c85d865ed4e5b97e8941135c742fd390738c50Ivan MolodetskikhParent: 367e495
More winit events can process after CloseRequested, which will cause a
panic if trying to access the now-removed output.
src/backend/winit.rsmodified+1 -4
@@ -107,10 +107,7 @@ impl Winit {
107 WinitEvent::Redraw => state107 WinitEvent::Redraw => state
108 .niri108 .niri
109 .queue_redraw(state.backend.winit().output.clone()),109 .queue_redraw(state.backend.winit().output.clone()),
110- WinitEvent::CloseRequested => {110+ WinitEvent::CloseRequested => state.niri.stop_signal.stop(),
111- state.niri.stop_signal.stop();
112- state.niri.remove_output(&state.backend.winit().output);
113- }
114 })111 })
115 .unwrap();112 .unwrap();
116 113