forge
Explore
Log in

Don't you dare go Hollow

Fix input lock when starting compositor while on a different TTY (#3593)

Browse files at this commit

6fc50a1fb82a8f5925e297e47dcb935db9c5eeefUnverifiedDubakula Sai Venkata Chaitanya and Ivan MolodetskikhParent: 5e11b96
* fix: no longer input locks when TTY is switched before full compositor
start

* reword

---------
src/backend/tty.rsmodified+8 -0
@@ -441,6 +441,14 @@ impl Tty {
441 }441 }
442 .map_err(|()| anyhow!("error assigning the seat to libinput"))?;442 .map_err(|()| anyhow!("error assigning the seat to libinput"))?;
443 443
444+ // If the session is not active at startup (e.g. niri was launched from a different TTY),
445+ // suspend libinput now so that when ActivateSession fires, libinput.resume() performs a
446+ // full re-enumeration of input devices instead of being a no-op.
447+ if !session.is_active() {
448+ debug!("session is not active, starting libinput in paused state");
449+ libinput.suspend();
450+ }
451+
444 let input_backend = LibinputInputBackend::new(libinput.clone());452 let input_backend = LibinputInputBackend::new(libinput.clone());
445 event_loop453 event_loop
446 .insert_source(input_backend, |mut event, _, state| {454 .insert_source(input_backend, |mut event, _, state| {