tty: Guard against output disappearing immediately after connection
Browse files at this commit289ae3604d705cebc82cbcd23ee4534ded16d3afParent: 55fb8851 changed file +3 -0
- src/backend/tty.rs +3 -0
src/backend/tty.rsmodified+3 -0
| @@ -1061,7 +1061,10 @@ impl Tty { | |||
| 1061 | if niri.monitors_active { | 1061 | if niri.monitors_active { |
| 1062 | // Redraw the new monitor. | 1062 | // Redraw the new monitor. |
| 1063 | niri.event_loop.insert_idle(move |state| { | 1063 | niri.event_loop.insert_idle(move |state| { |
| 1064 | + // Guard against output disconnecting before the idle has a chance to run. | ||
| 1065 | + if state.niri.output_state.contains_key(&output) { | ||
| 1064 | state.niri.queue_redraw(&output); | 1066 | state.niri.queue_redraw(&output); |
| 1067 | + } | ||
| 1065 | }); | 1068 | }); |
| 1066 | } | 1069 | } |
| 1067 | 1070 | ||