Skip to main content

idle_for_typing_defer

Function idle_for_typing_defer 

Source
pub(super) fn idle_for_typing_defer(
    reading: Option<u64>,
    promoted_idle_secs: u64,
    locked: Option<bool>,
) -> Option<u64>
Expand description

Idle seconds the typing-defer check should see. Some only when we can affirmatively judge activity — a real HID reading this tick, or a locked session (the user is definitely away). None when idle detection is unavailable and the lock state is unknown/unlocked, so the caller skips deferral rather than stalling every break for the full cap (#67). promoted_idle_secs already folds in the lock promotion, so the Some branch carries the value the rest of the scheduler sees. Pure so the unavailable-on-Wayland case is testable.