From 289ae3604d705cebc82cbcd23ee4534ded16d3af Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 20 Oct 2024 20:15:28 +0300 Subject: tty: Guard against output disappearing immediately after connection Fixes https://github.com/YaLTeR/niri/issues/739 --- src/backend/tty.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/backend/tty.rs b/src/backend/tty.rs index 439270a9..58face27 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -1061,7 +1061,10 @@ impl Tty { if niri.monitors_active { // Redraw the new monitor. niri.event_loop.insert_idle(move |state| { - state.niri.queue_redraw(&output); + // Guard against output disconnecting before the idle has a chance to run. + if state.niri.output_state.contains_key(&output) { + state.niri.queue_redraw(&output); + } }); } -- cgit