Skip to content

feat(lockscreen): add configurable grace period for passwordless unlock - #4032

Open
john-okeefe wants to merge 4 commits into
noctalia-dev:mainfrom
john-okeefe:feat/lockscreen-grace-period
Open

feat(lockscreen): add configurable grace period for passwordless unlock#4032
john-okeefe wants to merge 4 commits into
noctalia-dev:mainfrom
john-okeefe:feat/lockscreen-grace-period

Conversation

@john-okeefe

Copy link
Copy Markdown

Allow unlocking without a password shortly after locking, matching hyprlock's behavior: within the configured window after the lock request, any keypress or mouse movement exceeding 5px immediately unlocks the screen.

Summary

Adds a configurable grace period to the lock screen ([lockscreen] grace_period_seconds, default 5s, range 0–60, 0 disables it entirely). While the window is open, any keypress or mouse movement beyond 5px unlocks without a password. This restores a feature that existed in the Quickshell-based Noctalia 4 lock screen (commit cbfe0aa92), reimplemented against the v5 ext-session-lock-v1 surface stack.

Motivation

The v5 lock screen always requires a password, which is friction when locking accidentally or by idle trigger and immediately returning. Hyprlock offers a short passwordless window; this PR brings v5 in line with that.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Related Issue

None — mirrors the author's v4 pr (noctalia-shell commit cbfe0aa92).

Testing

  • just configure release / just build release — clean (733 targets).
  • just test release — 89/90 pass. The single failure (upower_charge_limit_integration) is pre-existing: it segfaults identically on base a064c063 and is unrelated to this PR.
  • noctalia config validate — clean with the new key in a real config.
  • python3 tools/i18n-check.py — OK (new settings.schema.lockscreen.grace-period strings present).
  • Manual runtime testing on Hyprland: lock, then keypress within the window unlocks immediately; mouse movement beyond 5px unlocks; after the window expires the password is required; grace_period_seconds = 0 always requires the password.

Manual Coverage

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

Screenshots / Videos

None — no visual change (single settings stepper added).

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed (Arch Linux).
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation after merge, or this PR does not change user-facing configuration or behavior.
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

Additional Notes

  • Implementation notes: the grace window uses a wall-clock timestamp comparison evaluated fresh on every key/pointer event (never cached, so it always expires on schedule); lockedAt/grace state live on LockScreen and survive WlSessionLockSurface recreation on resume; the logind resume path explicitly revokes grace as a safety net, though the wall-clock check alone would also expire it.
  • example.toml documents the new key.

Allow unlocking without a password shortly after locking, matching hyprlock's behavior: within the configured window after the lock request, any keypress or mouse movement exceeding 5px immediately unlocks the screen.

Key implementation details:
- Configurable via [lockscreen] grace_period_seconds (default 5, range 0-60); 0 disables the grace period entirely.
- Grace window uses a wall-clock timestamp comparison evaluated fresh on every key and pointer event, so the window always expires on schedule.
- lockedAt timestamp and grace state live on LockScreen and persist across WlSessionLockSurface recreations on resume.
- logind resume handling explicitly revokes grace as a safety net, though the wall-clock check alone would also expire it.
- Settings UI: stepper (0-60s) in Lock Screen > Security settings, with translation strings and example.toml documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant