srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2025-11-20 17:10:00 +0200
committersrdusr <[email protected]>2025-11-20 17:10:00 +0200
commitae47a562bd423df856ec6c735d9e4c29a8e1e3c6 (patch)
tree6fa732650b8809d0c302017fbc72254c66bccc02 /docs
parent04466601f4714dcbc1f3b0ef134febede6febb6a (diff)
downloadsrdwm-ae47a562bd423df856ec6c735d9e4c29a8e1e3c6.tar.gz
srdwm-ae47a562bd423df856ec6c735d9e4c29a8e1e3c6.zip
Redesign the native lock screen: clock/avatar header, on-screen keyboard, wrong-password shake
The native lock UI was a flat bordered rectangle with three left-aligned text lines and no shadow, clock, or identity marker - reported directly as looking unfinished. Splits the redesign across a new transparent-canvas header (time, date, circular avatar, username) above a redesigned, centered password box with a real drop shadow and a dimmed placeholder prompt, plus a genuine on-screen QWERTY-shaped keyboard with working Shift/Backspace/Return/Space and real click hit-testing shared with the render path via one `lock_stack_layout` function, and a damped-sine shake on a failed attempt. LockConfig gains show_clock/show_keyboard/avatar_bg, each independently srd.set-able and documented in a new theme.lock.* section in DEFAULTS.md. native_lock_render_elements now takes one NativeLockFrame struct instead of positional buffer arguments now that it composites five optional layers instead of two. Full workspace build/test/clippy clean (152 wayland tests, +6 new).
Diffstat (limited to 'docs')
-rw-r--r--docs/DEFAULTS.md36
-rw-r--r--docs/TODO.md16
2 files changed, 52 insertions, 0 deletions
diff --git a/docs/DEFAULTS.md b/docs/DEFAULTS.md
index 31daf22..3986654 100644
--- a/docs/DEFAULTS.md
+++ b/docs/DEFAULTS.md
@@ -486,6 +486,42 @@ either order, though `"traffic_lights"` paired with `button_side =
(Windows/GNOME) are the two ready-made combinations `config/srd/
themes.lua` ships (`macos` and `traditional` presets respectively).
+### Lock Screen (`theme.lock.*`)
+
+srdwm's own built-in session-lock UI (`srd dispatch lock`), not a config
+table - each key is a flat `srd.set` value, read once when the lock
+engages:
+
+```lua
+srd.set("theme.lock.box_bg", "#2e3440") -- Default: Nord dark
+srd.set("theme.lock.box_border", "#88c0d0") -- Default: Nord blue
+srd.set("theme.lock.text_color", "#eceff4") -- Default: Nord light
+srd.set("theme.lock.error_color", "#bf616a") -- Default: Nord red
+srd.set("theme.lock.corner_radius", 10) -- Default: 10
+srd.set("theme.lock.blur_radius", 20) -- Default: 20 (0 disables blur)
+srd.set("theme.lock.dot_char", "\u{25cf}") -- Default: "\u{25cf}" (a filled circle)
+srd.set("theme.lock.show_caps_lock", true) -- Default: true
+srd.set("theme.lock.show_failed_attempts", true) -- Default: true
+srd.set("theme.lock.fail_message", "Wrong password") - Default: "Wrong password"
+srd.set("theme.lock.show_clock", true) -- Default: true
+srd.set("theme.lock.show_keyboard", true) -- Default: true
+srd.set("theme.lock.avatar_bg", "#88c0d0") -- Default: Nord blue, matches box_border
+```
+
+`show_clock` adds a large time/date readout above the password box, plus a
+circular avatar (the username's first letter) and the username itself --
+the set of things a mainstream lock screen (GNOME, macOS, Windows) shows.
+Setting it to `false` reduces the lock screen to just the password box.
+
+`show_keyboard` adds an on-screen keyboard below the password box, for a
+session with no physical keyboard reachable (a touchscreen device). A real
+physical keyboard still works identically either way; this only adds a
+second input method, it never replaces the first. Tapping `Shift` toggles
+between the lowercase and uppercase/symbol rows.
+
+`avatar_bg` sets the avatar circle's fill colour. It defaults to the same
+value as `box_border` rather than a third independent colour to track.
+
### Getting a full macOS look
`apply(macos)` in `config/srd/themes.lua` covers everything srdwm itself
diff --git a/docs/TODO.md b/docs/TODO.md
index b1dd5d6..27234ea 100644
--- a/docs/TODO.md
+++ b/docs/TODO.md
@@ -1,5 +1,21 @@
# TODO / planned features - master checklist
+## Lock screen: real content, not a bare box, plus a working on-screen keyboard (2026-08-28)
+
+Asked directly: the native lock UI "shouldn't show a square, looks ugly/AI like," should have "other features like a normal lock," and needs a virtual keyboard. Read `render_ui_box` cold and the complaint was accurate - a flat, bordered rectangle with three left-aligned text lines (username, password dots, status), no clock, no avatar, no shadow. Every mainstream lock screen (GNOME, macOS, Windows) shows a clock/date and some identity marker; this one showed neither.
+
+Split the redesign across two new sections that float independently over the blurred desktop capture, rather than cramming more into the one panel: a header (`render_header_box`, drawn on a fully transparent canvas the same way `decoration.rs`'s own snap-flyout labels are, so nothing behind the glyphs gets painted over) showing the current time, date, a circular avatar with the username's first letter, and the username itself; and the password box itself (`render_ui_box`), now centered rather than left-aligned, shrunk from 360x170 to 340x120 now that the username line moved out of it, with a dimmed "Enter Password" placeholder while empty instead of a blank field that read as broken. `LockConfig` gained `show_clock`/`show_keyboard`/`avatar_bg`, each independently `srd.set`-able and documented in `docs/DEFAULTS.md`'s new `theme.lock.*` section (which didn't exist as a documented section at all before this, despite most of these keys already existing) - `show_clock`/`show_keyboard` default `true`, `avatar_bg` defaults to the same value as `box_border` rather than a fourth colour to configure.
+
+**A real on-screen keyboard, not just a config stub.** A QWERTY-shaped 5-row layout (`render_keyboard`) - digits with their shifted symbols, the three letter rows, Backspace, Return, Shift, Space - drawn as individually rounded keycaps, floating below the password box the same transparent-canvas way the header does. `Shift` toggles between the lowercase and uppercase/symbol rows and re-renders the keyboard bitmap on toggle (cheap: this is a low-frequency interaction, not a per-frame cost). Click routing is genuinely hit-tested against each key's own real rect, computed by the exact same `lock_stack_layout` function both the render path and `CompState::native_lock_click` call - so the two can never disagree about where a key visually is versus where a click resolves to, the same reasoning `srdwm_core::TITLEBAR_HEIGHT` already gets for titlebar hit-testing versus rendering. Wired into `input/pointer.rs`'s locked-click branch, ahead of the existing generic forward-to-lock-surface behaviour (which still applies for an external `LockSurface`-based locker, or with the keyboard hidden).
+
+**A small "wrong password" shake**, the same feedback every mainstream lock screen gives on a failed attempt: `poll_native_lock_auth`'s two failure branches now record `Instant::now()`, and a pure `shake_offset(elapsed)` (damped sine, `SHAKE_DURATION` = 400ms, `SHAKE_AMPLITUDE` = 10px) shifts the password box and its drop shadow horizontally each frame until it decays back to zero - a state machine already fully in place (`checking`/`show_error`), just with nothing visible attached to a failure before this.
+
+The password box's own drop shadow (previously absent entirely - `render_ui_box` never built one) now reuses `decoration.rs`'s existing `shadow_bitmap`/`shadow_rect` helpers, the same shadow every floating window's own decoration already gets, rather than a bespoke lock-specific one.
+
+`native_lock_render_elements`'s signature changed from four positional buffer arguments to one `NativeLockFrame` struct (background/header/shadow/ui/keyboard/shake_offset) - the four-argument version was already at its readability limit before this added three more optional layers; both call sites (`udev/render.rs`, `winit/render.rs`) extract every layer up front, before the renderer/backend borrow starts, the same pattern the pre-existing `native_bg`/`native_ui` extraction already established.
+
+Full workspace build/test/clippy clean (152 wayland tests, +6 for `lock_stack_layout`/`shake_offset`/`render_keyboard`'s own hit-rect and key-completeness invariants). Not yet visually verified against the real lock screen: `srd dispatch lock` is on the nightshift deny-list specifically to prevent an autonomous session from locking the user out of their own live session, so this needs the user to trigger a real lock and confirm it looks and behaves as intended, or a raw IPC socket write against a disposable nested compositor instance.
+
## GPU render path: decorations built after all, on explicit repeated instruction - scoped, not the full port (2026-08-28)
The 2026-08-27 entry below this one explains why a full port of the Pixman path's decoration rendering onto the GPU path was deliberately not attempted blind: no working GPU-capable hardware on this machine to visually confirm a single pixel of it against, on a feature nobody has turned on. That reasoning stands unchanged. Asked directly, twice, to build it anyway rather than leave it - so this is a real implementation, with the same unverified-on-hardware caveat stated as plainly as before, not a walk-back of the original judgment call.