From d448a82990efb5c510064f1de5b5d32e932a4f9e Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Sat, 4 Jul 2026 14:22:00 +0200 Subject: Use the real user avatar on the lock screen, and let its keyboard type every character Two gaps, both found by being asked about them. ~/.face was never read. The file exists here, a 300x300 JPEG, and a grep for .face/AccountsService/avatar_path returned nothing anywhere in the codebase: the lock screen drew a coloured circle with the user's initial unconditionally. It now looks for ~/.face, ~/.face.icon, then /var/lib/AccountsService/icons/$USER, which is where GNOME and KDE keep the picture their settings UI sets. Scaled to cover the circle and centre-cropped rather than letterboxed, and masked with a soft edge. Falls back to the initial when nothing is set or the file will not decode. That needed a raster decoder, since ~/.face is JPEG and the only image code here was resvg, which is SVG-only. Added image with default features off and only jpeg and png. The on-screen keyboard could not type most passwords. It had letters, digits, and the digits' own shifted symbols, and nothing else - no -, _, ., /, =, [, ], ;, ', comma, backslash or backtick. For the case that keyboard exists for, a session with no reachable physical keyboard, a password containing any of those meant no way in at all. Every printable ASCII character now has a key, with a test asserting the whole 0x20..0x7f range rather than spot-checking. The lock screen itself could not be screenshotted: locking a nested instance hits the pre-existing EGL context-loss crash already recorded in docs/TODO.md, confirmed again here. That is environmental and predates this change, so the on-screen appearance still needs the real session. The avatar path is covered by four tests including one that decodes the real ~/.face through the same function the lock screen calls. 529 tests pass, clippy clean. --- crates/wayland/Cargo.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/wayland/Cargo.toml') diff --git a/crates/wayland/Cargo.toml b/crates/wayland/Cargo.toml index 3e2c40d..7ca69e5 100644 --- a/crates/wayland/Cargo.toml +++ b/crates/wayland/Cargo.toml @@ -52,6 +52,12 @@ xcursor = "0.3.11" # other "pinned to smithay's own version" dependency above - both need to # see one identical `Keysym` type, not two incompatible ones. xkbcommon = { version = "0.8", features = ["wayland"] } +# Raster decoding for the lock screen's user avatar (`~/.face` and the +# AccountsService icon are conventionally JPEG or PNG, not SVG, so `resvg` +# below cannot read them). Default features off: this needs two codecs, not +# the whole format zoo, on a compositor that has to build on a low-spec +# machine. +image = { version = "0.25.10", default-features = false, features = ["jpeg", "png"] } resvg = "0.48.1" usvg = "0.48.1" tiny-skia = "0.12.0" @@ -84,3 +90,7 @@ features = [ "wayland_frontend", "xwayland", ] + +[dev-dependencies] +# Avatar decoding tests write a real image to a throwaway directory. +tempfile = "3" -- cgit v1.2.3