Clamp the lock screen's password field to the screen width - #11244
Open
SimonSchubert wants to merge 1 commit into
Open
Clamp the lock screen's password field to the screen width#11244SimonSchubert wants to merge 1 commit into
SimonSchubert wants to merge 1 commit into
Conversation
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.
SimonSchubert
marked this pull request as ready for review
September 10, 2026 22:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The lock screen's password field is wider than any screen narrower than it, so its outline and rounded corners are cut off on both sides.
LockViewsetsfieldWidth: 381, a fixed width on a field anchoredcenterIn: parent. At 360 logical the field runs from x = −11 to x = 370. Its left and right borders are off-screen, so it reads as a full-width band:The change
Clamp the field to the screen, less
Style.gapsOuton each side. That's the same margin the polkit and reminder cards already leave withpanel.width - Style.gapsOut * 2:root.widthis 0 until the lock surface is sized. The guard keeps the field at 381 until then, instead of a negative width.Why it's safe
Math.minreturns 381 and the field is unchanged.passwordInput.width, which follows the field, so long passwords still stay visible in a narrower field.Verification
Per
agents/skills/visual-verification.md, reference and candidate captures ofomarchy-shell lock preview:The VM runs a v4.0.3 shell, where
LockViewpredatesBackgroundMedia. To test this exact file rather than a backport, I addedBackgroundMedia.qmlandUtil.isVideoPathfromquattrofor the test. The field code is identical in both versions.A companion to #11034 and #11238, found the same way on a phone-shaped screen. Like those, it's a narrow-screen robustness fix rather than a mobile-specific one.