Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ tools/phone-ssh CMD -> run anything; stream files with ssh 'cat > f' < f
| `tools/wifi-w1-capture`, `acpm-stage`, `aoc-stage`, `fingerprint-capture` | Staged bring-up: kmsg streamed to `logs/` first, optional `--watchdog` feeder, `--pstore` afterwards |
| `tools/usbc-deadman` (+ `usbc-deadman-phone`) | USB-C/charger steps under a dead-man switch; `dump` is read-only |
| `tools/display-hz` | Read-only refresh-rate measurement from DECON's frame counter |
| `tools/lock-turn-test` | On-phone check that a locked screen follows a turn of the monitor (`packages/hyprland` 0003): run as the session's user, it locks for about five seconds with a bare lock client of its own, turns the monitor a quarter and back with a transform-only rule change, and compares the lock surface's size with the monitor's. No root; the client opens by itself after 20 s and the monitor is turned back on exit (`--unlock` opens a lock a killed run left). Takes over the screen: announce it |
| `tools/power-ab` | On-phone A/B battery-drain test (runs detached; the cable is out) |
| `tools/bt-uart-test`, `cs35l41-id`, `ff-rumble`, `usf.py` | On-phone probes, streamed with `tools/phone-ssh python3 - < tool` |
| `tools/aoc-audio-diag` | On-phone AoC playback diagnosis (`tools/phone-ssh 'EP=6 MODES=copy bash -s' < tools/aoc-audio-diag`): plays a short tone under `timeout`, snapshots mailbox IRQs, ring counters, CS35L41 registers and DAPM. `EP=` entry point, `MODES=` copy/mmap, `AOCLOG=1` records the AoC firmware log, `SETUP2=0/1` sets `ep_setup2` |
Expand Down Expand Up @@ -150,6 +151,7 @@ Each entry gives the gotcha, then the reason or the fix. Details are in the link
- **Hyprland refused DPMS commits while a flip was in flight,** and gave up after one retry. Our `packages/hyprland` patch keeps retrying. [packages/hyprland/README.md](packages/hyprland/README.md)
- **With the panel really off (gs-decon `screen_off=2`), Omarchy's key handling broke:** `key_press_enables_dpms` lit the screen on the power key's press, so its release turned it off again, and Omarchy's lock waits for a lit screen, so locking after power-off lit the PIN pad. `omamobile-shell` 0.1.20 wakes only through `omamobile-keys` (and touch), and locks behind a zero backlight before powering the panel off.
- **Hyprland 0.56 on Omarchy uses the Lua config,** so dispatchers take Lua syntax: `hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })'` (or `"enable"`), not `dpms off`.
- **A monitor rule that only turns the screen sends no `modeChanged` in Hyprland 0.57** (`applyMonitorRuleSoft()`), and a session-lock surface was configured only on that event: a phone turned back to portrait after it locked on its side kept a landscape-sized lock screen, drawn stretched, until it was unlocked (#522). Our `packages/hyprland` 0003 configures the lock surface on a layout change too, and `tools/lock-turn-test` checks it on a phone. A rule whose scale is written differently from the active one (`2.66667` against `2.6666667`) takes the full path and hides the gap, so a test must change the transform alone. And while the display is off Hyprland applies no rule change until the next wake (seen in a VM, not yet on a phone). [packages/hyprland/README.md](packages/hyprland/README.md)

### Buses and drivers

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
Subject: [PATCH] session-lock: configure the lock surface when the monitor is turned

Against Hyprland v0.57.0 (src/protocols/SessionLock.cpp, SessionLock.hpp).

A lock surface gets its size in ext_session_lock_surface_v1.configure, and
CSessionLockSurface sends one whenever its monitor emits modeChanged. Since
the monitor rules are split into hard and soft properties, a rule change
that only differs in the transform is applied by
CMonitor::applyMonitorRuleSoft(): it gives the monitor its turned size, the
layout is arranged again (layer surfaces are configured, xdg_output sends
the new logical size), but modeChanged is not emitted. So a lock surface is
never told about a quarter turn: the client keeps drawing at the size the
surface was made with, and the renderer draws that buffer stretched over
the turned output until the session is unlocked. Touch no longer lines up
with what is drawn either.

Seen on a phone whose screen follows the accelerometer: locked on its side,
the screen is turned back to portrait a moment after the lock surface is
made, and the lock screen stays squeezed. With WAYLAND_DEBUG on a lock
client (1080x2424 at scale 8/3): ext_session_lock_surface_v1.configure(405,
909) at the lock, then none for four quarter turns, while
zxdg_output_v1.logical_size went to 909x405 and back each time.

Have 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.

diff --git i/src/protocols/SessionLock.cpp w/src/protocols/SessionLock.cpp
--- i/src/protocols/SessionLock.cpp
+++ w/src/protocols/SessionLock.cpp
@@ -7,6 +7,7 @@
#include "../output/Monitor.hpp"
#include "../render/Renderer.hpp"
#include "../desktop/state/FocusState.hpp"
+#include "../event/EventBus.hpp"

CSessionLockSurface::CSessionLockSurface(SP<CExtSessionLockSurfaceV1> resource_, SP<CWLSurfaceResource> surface_, PHLMONITOR pMonitor_, WP<CSessionLock> owner_) :
m_resource(resource_), m_sessionLock(owner_), m_surface(surface_), m_monitor(pMonitor_) {
@@ -68,6 +69,15 @@
m_surface->enter(m_monitor.lock());

m_listeners.monitorMode = m_monitor->m_events.modeChanged.listen([this] { sendConfigure(); });
+
+ // A rule change that only turns the monitor goes through applyMonitorRuleSoft(),
+ // which gives it its new size without modeChanged. Follow the layout as well, or
+ // the lock surface keeps the size it was made with and is drawn stretched over
+ // the turned output until the session is unlocked.
+ m_listeners.monitorLayout = Event::bus()->m_events.monitor.layoutChanged.listen([this] {
+ if (m_monitor && m_monitor->m_size != m_configuredSize)
+ sendConfigure();
+ });
}

sendConfigure();
@@ -88,6 +98,7 @@
}

const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->seatResourceForClient(m_resource->client()));
+ m_configuredSize = m_monitor->m_size;
m_resource->sendConfigure(SERIAL, m_monitor->m_size.x, m_monitor->m_size.y);
}

diff --git i/src/protocols/SessionLock.hpp w/src/protocols/SessionLock.hpp
--- i/src/protocols/SessionLock.hpp
+++ w/src/protocols/SessionLock.hpp
@@ -5,6 +5,7 @@
#include "WaylandProtocol.hpp"
#include "ext-session-lock-v1.hpp"
#include "../helpers/signal/Signal.hpp"
+#include "../helpers/math/Math.hpp"

class CSessionLock;
class CWLSurfaceResource;
@@ -33,11 +34,13 @@

bool m_ackdConfigure = false;
bool m_committed = false;
+ Vector2D m_configuredSize;

void sendConfigure();

struct {
CHyprSignalListener monitorMode;
+ CHyprSignalListener monitorLayout;
CHyprSignalListener surfaceCommit;
CHyprSignalListener surfaceDestroy;
} m_listeners;
19 changes: 15 additions & 4 deletions packages/hyprland/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
# [extra] in pacman.conf, so pacman takes this build either way.
# - pkgrel 3.3: the rotation hold's half turn over Android's 383 ms and the
# old frame faded out on Android's alpha-out curve (3.2 is published).
# - 0003-session-lock-configure-the-lock-surface-on-a-turn.patch: a rule
# change that only turns the monitor (what omamobile-autorotate sends)
# is applied without modeChanged, the one event a lock surface was
# configured on. A phone locked on its side, or turned as it locked, kept
# a lock screen of the old size, drawn stretched over the turned output
# until it was unlocked (#522). The lock surface now follows the monitor
# layout too. pkgrel 3.4 (3.3 is published).
# - arch=(aarch64) only.
# - build() runs the two cmake steps of `make release` itself, with
# CMAKE_SKIP_RPATH (Arch's Makefile sed) and the job count from MAKEFLAGS
Expand All @@ -36,8 +43,8 @@

pkgname=(hyprland hyprpm)
pkgver=0.57.0
pkgrel=3.3
pkgdesc='a highly customizable dynamic tiling Wayland compositor (Omarchy Mobile: DPMS retry, rotation hold)'
pkgrel=3.4
pkgdesc='a highly customizable dynamic tiling Wayland compositor (Omarchy Mobile: DPMS retry, rotation hold, lock surface follows a turn)'
arch=(aarch64)
url="https://github.com/hyprwm/Hyprland"
license=(BSD-3-Clause)
Expand Down Expand Up @@ -104,13 +111,15 @@ source=("$_archive.tar.gz::$url/releases/download/v$pkgver/source-v$pkgver.tar.g
wl-output-global-grace.patch
monitor-rule-vrr.patch
0001-dpms-keep-retrying-a-refused-dpms-commit.patch
0002-render-hold-the-last-frame-across-a-rotation.patch)
0002-render-hold-the-last-frame-across-a-rotation.patch
0003-session-lock-configure-the-lock-surface-on-a-turn.patch)
sha256sums=('82d006ba9264fe67266c7d583c16f1a6c64d51424dbdc472c3e9c9d5ddfcd559'
'26d62139b8ae55e286bcdff1838a6bc01a021d8f1039b40b8fa523df83f61610'
'8fa0f57dc1b3246ab4e30ae81419150f4af7767fb31e739e36c824c6d99fab73'
'c14fb0ec02d97100bcfa4e5c8daaf524972fa5c665e04960619744ba01c73c39'
'a5670d9a6cdee3f3990a81cdecfd5e1f95771ebd1d7b1e2622ac7187684b8836'
'c69e64fe55a25a7baa2751ff795ae1f8a1ddfc1d162b9b35f9d821675be02bb7')
'c69e64fe55a25a7baa2751ff795ae1f8a1ddfc1d162b9b35f9d821675be02bb7'
'3849c832de8fbbacf344bcb1601f2d25789c2f4e87e44f12a6f88f74dafd482b')

prepare() {
ln -sf hyprland-source "$_archive"
Expand All @@ -125,6 +134,8 @@ prepare() {
patch -Np1 --fuzz=0 -i "$srcdir/0001-dpms-keep-retrying-a-refused-dpms-commit.patch"
# Omarchy Mobile: hold the last frame across a rotation until the layers have drawn, then turn it in as Android does
patch -Np1 --fuzz=0 -i "$srcdir/0002-render-hold-the-last-frame-across-a-rotation.patch"
# Omarchy Mobile: a monitor that is only turned configures its lock surface again
patch -Np1 --fuzz=0 -i "$srcdir/0003-session-lock-configure-the-lock-surface-on-a-turn.patch"
sed -i -e '/find_package.glaze/s/7...<8 //' {.,hyprpm,start}/CMakeLists.txt
}

Expand Down
61 changes: 57 additions & 4 deletions packages/hyprland/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# hyprland (Omarchy Mobile build)

This is Omarchy's Hyprland 0.57.0-2 recipe (`hyprland` and `hyprpm`), built
for aarch64 with two changes. Hyprland gave up on a refused DPMS commit after
for aarch64 with three changes. Hyprland gave up on a refused DPMS commit after
a single retry, and aquamarine refuses commits while a page flip is in
flight. So when a client kept rendering, DPMS off was lost: Hyprland
reported the screen off, but the CRTC never turned off. See
Expand All @@ -14,6 +14,7 @@ reported the screen off, but the CRTC never turned off. See
| `nvidia-egl-teardown.patch`, `wl-output-global-grace.patch`, `monitor-rule-vrr.patch` | Omarchy's patches from the same commit, unchanged (what they fix: their comments in `prepare()`) |
| `0001-dpms-keep-retrying-a-refused-dpms-commit.patch` | The Omarchy Mobile change to `src/output/Monitor.cpp` |
| `0002-render-hold-the-last-frame-across-a-rotation.patch` | The Omarchy Mobile change to `src/render/Renderer.cpp` and `src/render/OpenGL.cpp` (the rotation hold, below) |
| `0003-session-lock-configure-the-lock-surface-on-a-turn.patch` | The Omarchy Mobile change to `src/protocols/SessionLock.cpp` and `SessionLock.hpp` (a turned monitor configures its lock surface, below) |

## What differs from Omarchy's `hyprland` 0.57.0-2

Expand All @@ -32,11 +33,27 @@ reported the screen off, but the CRTC never turned off. See
Hyprland's environment (read once at startup): `omamobile-device-panther`
sets it in `environment.d`, and the other phones rotate as before until
it has run on them.
- `pkgrel=3.3`: the higher of Omarchy's (0.57.0-2) and Arch Linux ARM's
- The lock surface follows a turn (0003). Hyprland 0.57 applies a monitor
rule that differs from the active one only in "soft" properties, the
transform among them, through `CMonitor::applyMonitorRuleSoft()`: the
monitor gets its turned size and the layout is arranged again, but
`modeChanged` isn't emitted, and that event is the only one on which a
session-lock surface is sent a new `configure`. omamobile-autorotate's
rule change is exactly that, so a phone locked on its side, or turned as
it locked, kept a lock screen of the size it was made with after
autorotate turned the locked screen back to portrait: drawn stretched
over the turned output, with touch off its targets, until it was unlocked
(#522). The lock surface now also follows the monitor layout, as
`xdg_output` does, and is sent a `configure` when the monitor's size is
no longer the one it was last told. A turn made while the display is off
is applied by Hyprland at the next wake, and the lock surface is
configured then. Hyprland's main branch had the same gap on 2026-11-13.
- `pkgrel=3.4`: the higher of Omarchy's (0.57.0-2) and Arch Linux ARM's
(`extra/hyprland` 0.57.0-3, a rebuild for aquamarine 0.16.0 and
hyprgraphics 0.6.0) release, plus `.1`, so it sorts above both; `.2` for
the rotation hold, since 3.1 is published; `.3` for the half turn's
383 ms and the alpha-out curve, since 3.2 is published.
383 ms and the alpha-out curve, since 3.2 is published; `.4` for the
lock surface, since 3.3 is published.
- `arch=(aarch64)` only.
- `build()` runs the two cmake steps of `make release` itself:
- with Arch's `-DCMAKE_SKIP_RPATH=ON` (Arch's PKGBUILD seds it into the
Expand All @@ -55,6 +72,36 @@ Omarchy dropped the patch, so it is gone here too.

## Status

**0.57.0-3.4 (0003, the lock surface follows a turn), built on 2026-11-13
and running on a Pixel 9a since 2026-11-14.** 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, the
versions the phone runs; all six patches apply with `--fuzz=0`.
`tools/lock-turn-test` locks with a bare lock client, 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:

| Where | hyprland | 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 |

With `WAYLAND_DEBUG=1` on a lock client in the VM, 0.57.0-3.1 sent one
`ext_session_lock_surface_v1.configure(405, 909)` at the lock and none for
four quarter turns, while `zxdg_output_v1.logical_size` followed each;
0.57.0-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`): on the 9a with 0.57.0-3.3, turned to landscape and back while
locked, it stayed 909x405 and was drawn squeezed into the portrait screen;
with 0.57.0-3.4, locked in landscape and then turned to portrait, it is
drawn at 405x909. In the VM with 0.57.0-3.4 it also came out right after a
turn made while the display was off (applied at the wake).

Not tested: the Pixel 7 Pro and the Pixel 7 (the rotation hold was only
run in the VM), and an external monitor.

**0.57.0-3.1, built natively on the phone (2026-11-02), not installed yet.**
Arch Linux ARM moved `extra` to aquamarine 0.16.0 (`libaquamarine.so=15`)
and hyprgraphics 0.6.0 (`libhyprgraphics.so=5`) and dropped the old
Expand Down Expand Up @@ -204,7 +251,13 @@ rebuilds:
hyprgraphics, hyprutils, ...), even with no new Hyprland: our build
pins the old one, and `extra` drops it.

Drop the DPMS patch once upstream retries refused DPMS commits.
Drop the DPMS patch once upstream retries refused DPMS commits, and 0003
once upstream configures a lock surface when its monitor is only turned
(`tools/lock-turn-test` passes without it then). #785's patch
(`output-send-the-whole-state-with-done`) is the same cause one protocol
over: after a transform-only rule `wl_output` clients keep the old
transform. Whoever drops one should check the other, since one upstream
fix to `applyMonitorRuleSoft()` would cover both.

**`tools/repo-build`:**
- Packages are listed explicitly, so add `packages/hyprland` only when it
Expand Down
Loading