From 12f0fdb889a1212718ecc059e2d4656c562838de Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Fri, 11 Sep 2026 00:52:06 +0200 Subject: [PATCH] Clamp the lock screen's password field to the screen width LockView sets fieldWidth to a fixed 381. The field is centred on the screen, so on a screen narrower than that it is wider than the screen itself: at 360 logical it runs from x=-11 to x=370, and its outline and rounded corners are cut off on both sides, leaving what reads as a full-width band. The field is now clamped to the screen width less Style.gapsOut on each side, the same margin the polkit and reminder cards already leave with panel.width - Style.gapsOut * 2. root.width is 0 until the lock surface is sized, so the clamp only applies once it has a real width. On a desktop Math.min returns 381 and the field is unchanged. Verified in a 720x1440 VM at scale 2 (360 logical), where the field clamps to 350 with 5px on each side, and at 1920x1080, where it stays 381 and the lock screen matches the unpatched one to within llvmpipe's anti-aliasing. --- shell/plugins/lock/LockView.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/plugins/lock/LockView.qml b/shell/plugins/lock/LockView.qml index e7a430ac67f..7b3a7c4fe5c 100644 --- a/shell/plugins/lock/LockView.qml +++ b/shell/plugins/lock/LockView.qml @@ -23,7 +23,8 @@ Item { property bool syncingPasswordText: false readonly property string placeholderText: "Enter Password" - readonly property int fieldWidth: 381 + // Clamped so the field cannot outgrow a narrow screen. + readonly property int fieldWidth: root.width > 0 ? Math.min(381, root.width - Style.gapsOut * 2) : 381 readonly property int fieldHeight: 67 readonly property int outlineThickness: 3 readonly property int fieldFontSize: Math.round(Style.font.heading * 1.125)