fix: don't wake displays on input device removal, count input wakes as activity

A sleeping wireless keyboard relit blanked displays and idle never re-armed.

Written with assistance from Claude Opus 5.0. Reviewed, built and tested by the
author, who understands the changes in full.
This commit is contained in:
dev-goalz 2026-09-21 18:00:15 +02:00 • committed by Victoria Brekenfeld
parent f60d2c8436
commit e5010c23c9
2 changed files with 15 additions and 1 deletions

View file

@ -220,7 +220,16 @@ impl State {
) where ) where
<B as InputBackend>::Device: 'static, <B as InputBackend>::Device: 'static,
{ {
// An input device going away is not user activity, e.g. a wireless keyboard
// dropping its link when it sleeps, so it must not power displays back on.
// Device additions still wake: after a system resume the re-enumerated
// devices may be the only input seen, and the wake resets idle anyway.
if !matches!(
&event,
InputEvent::DeviceRemoved { .. } | InputEvent::Special(_)
) {
crate::wayland::handlers::output_power::set_all_surfaces_dpms_on(self); crate::wayland::handlers::output_power::set_all_surfaces_dpms_on(self);
}
use smithay::backend::input::Event; use smithay::backend::input::Event;
match event { match event {

View file

@ -21,6 +21,11 @@ pub fn set_all_surfaces_dpms_on(state: &mut State) {
} }
if changed { if changed {
// Powering an output on because of input is activity. Without this the idle
// notifier stays idled, the idle daemon never sees `resumed`, and nothing
// powers the output off again until real input arrives.
let seat = state.common.shell.read().seats.last_active().clone();
state.common.idle_notifier_state.notify_activity(&seat);
OutputPowerState::refresh(state); OutputPowerState::refresh(state);
} }
} }