diff --git a/src/backend/tty.rs b/src/backend/tty.rs index 7b52b272dd..cf8493da6c 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -441,6 +441,14 @@ impl Tty { } .map_err(|()| anyhow!("error assigning the seat to libinput"))?; + // If the session is not active at startup (e.g. Niri was launched from a different TTY), + // suspend libinput now so that when ActivateSession fires, libinput.resume() performs a + // full re-enumeration of input devices instead of being a no-op. + if !session.is_active() { + debug!("session is not active, starting in paused state"); + libinput.suspend(); + } + let input_backend = LibinputInputBackend::new(libinput.clone()); event_loop .insert_source(input_backend, |mut event, _, state| {