From 6fc50a1fb82a8f5925e297e47dcb935db9c5eeef Mon Sep 17 00:00:00 2001 From: Dubakula Sai Venkata Chaitanya Date: Sun, 19 Apr 2026 11:44:38 +0530 Subject: [PATCH] Fix input lock when starting compositor while on a different TTY (#3593) * fix: no longer input locks when TTY is switched before full compositor start * reword --------- Co-authored-by: Ivan Molodetskikh --- src/backend/tty.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backend/tty.rs b/src/backend/tty.rs index dff16012..52f1db2e 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 libinput in paused state"); + libinput.suspend(); + } + let input_backend = LibinputInputBackend::new(libinput.clone()); event_loop .insert_source(input_backend, |mut event, _, state| {