Skip to content

hyprland 0.57.0-3.4: a turned screen configures its lock surface (#522) - #753

Open
den-kloot wants to merge 2 commits into
derekross:mainfrom
den-kloot:hyprland-lock-surface-turn
Open

den-kloot wants to merge 2 commits into
derekross:mainfrom
den-kloot:hyprland-lock-surface-turn

Conversation

@den-kloot

@den-kloot den-kloot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Part of #522: a phone locked on its side, or turned as it locked, kept a squeezed lock screen until it was unlocked (the clock narrow and tall, the PIN pad's touch off its targets).

The cause is in Hyprland 0.57, not in the lock or in autorotate:

  • A monitor rule that differs from the active one only in "soft" properties, the transform among them, is applied by CMonitor::applyMonitorRuleSoft() (CMonitorRuleManager::ensureMonitorStatus(), COMPARISON_SOFT_MISMATCH). The monitor gets its turned size and the layout is arranged again, but modeChanged is not emitted.
  • CSessionLockSurface sends ext_session_lock_surface_v1.configure only on modeChanged. So a lock surface never hears of a quarter turn: the client keeps drawing at the old size and the renderer stretches that buffer over the turned output.
  • omamobile-autorotate turns a locked screen back to portrait within its one-second poll, which is after the lock surface exists, with exactly such a rule change.

Hyprland's main branch had the same gap on 2026-11-13.

The change: packages/hyprland 0003 (src/protocols/SessionLock.cpp, .hpp, about 15 lines): the lock surface also follows the monitor layout, as xdg_output does, and sends a configure when the monitor's size is no longer the one it last sent. pkgrel 3.4.

The test: tools/lock-turn-test, run on the phone as the session's user. It locks for about five seconds with a bare lock client of its own (Quickshell, one surface that reports its size), turns the monitor a quarter and back with a rule change in which only the transform differs, and compares the lock surface's size with the monitor's. No root. The client opens by itself after 20 s whatever happens to the script, the monitor is turned back on exit (also after Ctrl-C or a hang-up), and --unlock opens a lock a killed run left behind.

Two things that hid the cause for a while, now in AGENTS.md:

  • Scale is a "hard" property, compared as a float. A rule written with 2.6666667 against an active 2.66667 takes the full path and does send a configure, so the first turn of an experiment can look fine. The test applies its own rule once before it locks.
  • While the display is off, Hyprland applies no rule change until the next wake.

Device and build

  • Phone: Pixel 9a (tegu)
  • Kernel release (uname -r): 7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78
  • Packages changed, with versions: hyprland 0.57.0-3.4

Built from this PKGBUILD in an Arch Linux ARM container on an aarch64 host (-j8, 6 min), against extra's aquamarine 0.16.0, hyprgraphics 0.6.0 and hyprutils 0.14.3 (libaquamarine.so=15, libhyprgraphics.so=5, as the phone has). The binary on the phone was built before I reworded the patch's description; the diff is the same, and the final files pass makepkg -o (checksums, all six patches with --fuzz=0).

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes (only tests/tools-help run: it passes with the new tool)
  • tests/packages passes (not run: packages/hyprland has no test/all, no other package is touched)
  • Each changed package has its version bumped, and the new version is in the commit subject (pkgrel 3.4)
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone, booted into this build
  • Runbook steps passed (plan, step, result):
Where hyprland tools/lock-turn-test, a quarter turn
Pixel 9a 0.57.0-3.3 not ok: the monitor is 909x405, the lock surface 405x909
A VM with the 9a's packages and phone session (vkms, 1080x2424 at 8/3) 0.57.0-3.1 not ok, the same sizes
The same VM 0.57.0-3.4 ok, three runs; ok twice more with OMAMOBILE_ROTATION_HOLD=1
Pixel 9a 0.57.0-3.4 ok, three runs
  • WAYLAND_DEBUG=1 on a lock client in the VM: 3.1 sends one configure(405, 909) at the lock and none for four quarter turns, while zxdg_output_v1.logical_size follows each; 3.4 sends a configure with the new size after each quarter turn.
  • Omarchy's own lock, read back from the scanout buffer (ffmpeg -f kmsgrab, since screencopy shows a locked screen black). On the 9a with 3.3: turned to landscape and back while locked, the surface stayed 909x405 and was drawn squeezed into the portrait screen. On the 9a with 3.4: locked in landscape, then turned to portrait, it is drawn at 405x909, and a swipe on it opens it.
  • In the VM with 3.4 the lock also came out right after a turn made while the display was off.
  • What I did not test: the Pixel 7 Pro and the Pixel 7 (the rotation hold ran only in the VM, by setting the variable); an external monitor; a turn while the display is off on the 9a itself; a physical turn by the accelerometer with 3.4 (the turns were made with hyprctl, with the rule autorotate sends).
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)

Not in this change: with 3.4 a phone locked on its side still shows the lock in landscape for up to a second or two before autorotate's poll turns it; it is then drawn right. Having the lock ask autorotate for portrait before it makes its surfaces would remove that.

tools/phone-smoke report

phone-smoke: unknown

Kernel 7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78, tools at unknown, 2026-11-14T05:28Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78, slot b, up 1480s
storage guard (required) ok 62 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 78G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg (0 known, 0 new)
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card1-DSI-1 connected, 1080x2424
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked false)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlp1s0 on brcmfmac, link up
Bluetooth ok hci0, powered true
battery ok 8% Charging, 42 °C
sound cards ok googleteguaocsn
sensors ok Accelerometer AmbientLight Proximity
cameras skip no libcamera tools
thermal ok hottest zone 57 °C

Packages: hyprland 0.57.0-3.4, libcamera 0.7.2-4.23, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.3-1, omamobile-audio 0.5.18-1, omamobile-device-tegu 0.2.18-1, omamobile-firstboot 0.1.5-1, omamobile-gnss 0.2.9-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-mmd 0.1.4-1, omamobile-modem 0.1.21-1, omamobile-modem-sit 0.3.35-1, omamobile-omarchy 0.1.44-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-settings 0.1.2-1, omamobile-shell 0.2.127-1, omamobile-voice 0.1.0-1, omaphone 0.2.3-1, omarchy 4.5.0-3, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1

🤖 Generated with Claude Code

…ekross#522)

A phone locked on its side, or turned as it locked, kept a squeezed lock
screen until it was unlocked: the clock narrow and tall, touch off its
targets. omamobile-autorotate turns a locked screen back to portrait
within its one-second poll, after the lock surface exists, and the lock
surface never heard of that turn.

Hyprland 0.57 applies a monitor rule that differs from the active one only
in the transform through CMonitor::applyMonitorRuleSoft(), which resizes
the monitor without emitting modeChanged, and a session-lock surface was
sent a configure on that event alone. 0003 has the lock surface follow the
monitor layout as well, as xdg_output does, and send a configure when the
monitor's size is no longer the one it last sent. pkgrel 3.4.

tools/lock-turn-test checks it on a phone: a bare lock client, a quarter
turn and back with a transform-only rule change, the lock surface's size
against the monitor's. It needs no root, the client opens by itself, and
the monitor is turned back on exit.

Tested: lock-turn-test fails on a Pixel 9a with 0.57.0-3.3 (monitor
909x405, lock surface 405x909) and passes three times with 0.57.0-3.4;
the same in a VM with the 9a's packages (3.1 fails, 3.4 passes, also with
OMAMOBILE_ROTATION_HOLD=1). Omarchy's lock on the 9a with 3.4, locked in
landscape and turned to portrait, is drawn at 405x909 (read back with
kmsgrab). All six patches apply with --fuzz=0. Not run on the Pixel 7 Pro
or the Pixel 7.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, den-kloot. This is a very good piece of work: you found that the lock wasn't the problem, that a transform-only rule goes through applyMonitorRuleSoft() without modeChanged, and that the lock surface listened to nothing else. Following layoutChanged and sending a configure only when the size really changed is the smallest fix that does it, and tools/lock-turn-test is careful: no root, a lock that opens on its own, the monitor turned back on exit, and it says to announce it.

I checked it against the 0.57.0 release: the sums match and all six patches apply with --fuzz=0. It also stacks with the other three open Hyprland PRs (#762, #785, #786) in any order. #785 is the same cause one protocol over (wl_output clients keep the old transform after a turn), so the two belong together.

Since it changes the lock on every phone and hasn't run on a Pixel 7 Pro yet, I'll run it on mine before merging, in one build with the other three, so the phone only needs one Hyprland install. In that order this one goes second, as 0.57.0-3.5 with the patch renamed 0004-…; I'll make that change on your branch when I merge, unless you'd rather do it yourself.

Three small things, none needed for the merge:

  1. The description says "Fixes Lock screen squeezed after locking in landscape: the lock surfaces are made before autorotate turns to portrait #522", which closes the issue on merge. You also note that a lock taken on its side still shows landscape for a second or two before autorotate turns it. If you'd like Lock screen squeezed after locking in landscape: the lock surfaces are made before autorotate turns to portrait #522 to keep tracking that, "Part of Lock screen squeezed after locking in landscape: the lock surfaces are made before autorotate turns to portrait #522" would keep it open.
  2. The last sentence of the AGENTS.md gotcha (no rule change applies while the display is off) is from the VM run; "seen in a VM" there would keep it accurate until a phone has shown it.
  3. A sentence in the README pointing at hyprland 0.57.0-3.4: send wl_output's geometry after a rotation #785's patch would help whoever drops these once upstream fixes it.

…ekross#785's patch

Review of derekross#753: the AGENTS.md gotcha's last sentence (no rule change applies while the display is off) was only seen in the VM, and says so now. The README's note on dropping 0003 names derekross#785's wl_output patch, the same cause one protocol over, so the two are looked at together once upstream fixes it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@den-kloot

Copy link
Copy Markdown
Contributor Author

Thank you for checking it against the release and against the other three.

92575f8a has the two text changes: the AGENTS.md sentence about the display being off says "seen in a VM, not yet on a phone", and the README's note on dropping 0003 names #785's patch as the same cause one protocol over.

The description says "Part of #522" now, so the issue keeps the second or two of landscape after a lock taken on its side.

Renaming the patch to 0004-… and the release to 3.5 when you merge is fine with me; the order depends on your build, so I'd rather not guess it here.

@derekross

Copy link
Copy Markdown
Owner

Thank you, den-kloot, all three are in exactly as I'd hoped: "Part of #522" keeps the issue for the second or two of landscape, the gotcha now says it's from a VM, and the README points at #785's patch.

I've now applied this together with the other three open Hyprland changes in every order they could merge, and every order gives the same compositor, so the numbering really is just bookkeeping. I'll do the rename to 0.57.0-3.5 and 0004-… on your branch when I merge, including the two mentions of 0003 in AGENTS.md and the one in tools/lock-turn-test, after the combined run on my Pixel 7 Pro. Nothing more is needed from you.

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.

2 participants