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:
parent
f60d2c8436
commit
e5010c23c9
2 changed files with 15 additions and 1 deletions
|
|
@ -220,7 +220,16 @@ impl State {
|
|||
) where
|
||||
<B as InputBackend>::Device: 'static,
|
||||
{
|
||||
crate::wayland::handlers::output_power::set_all_surfaces_dpms_on(self);
|
||||
// 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);
|
||||
}
|
||||
|
||||
use smithay::backend::input::Event;
|
||||
match event {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ pub fn set_all_surfaces_dpms_on(state: &mut State) {
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue