Skip to content

omamobile-omarchy 0.1.49: idle re-arms its monitor when the timeout changes - #879

Open
Somnius wants to merge 5 commits into
derekross:mainfrom
Somnius:omarchy-idle-rearm-1118
Open

Somnius wants to merge 5 commits into
derekross:mainfrom
Somnius:omarchy-idle-rearm-1118

Conversation

@Somnius

@Somnius Somnius commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Found this while testing the idle settings on my Pixel 8 Pro: if you change the lock or screensaver timeout while the shell is running, the new timeout never fires. Omarchy's idle service hands the new value to the IdleMonitor, but the monitor never reports idle again until you restart the shell.

To check it I set the timeout to 30 s and left the phone alone. With the stock file it was still unlocked after 100 s. With this patch, which switches the monitor off for 50 ms whenever firstIdleTimeoutSeconds changes so it starts fresh with the new timeout, it locked 31 s after the change. That was on Omarchy 4.0.6-1, quickshell 0.3.2.r7.g2b4501a-1 and Hyprland 0.57.0-3.2.

This is also why the new lock time from #866 (#866) didn't take effect until a restart. The setting was saved fine, the monitor just never picked it up.

It's patch 0032 in both series (4.5 and legacy 4.0.6), and omamobile-omarchy goes to 0.1.49. While the monitor is off for those 50 ms, handleIdleChanged() now returns early, so the off/on flip isn't taken as activity and can't cancel a running idle cycle or wake a locked display. I ran this final version on the phone too: shell restarted with 180 s set, changed to 30 s at 10:54:46, locked at 10:55:16.

The package tests pass against the real 4.0.6-1 and 4.5.0-3 packages except the qmlformat check (Background.qml, plus notifications/Service.qml on 4.0.6), which fails the same way on main with 4.5.0-3. I also changed test/source-family.py to check the legacy patches by name instead of a fixed count of 29, since adding 0032 broke it. I only tested it on the phone with 4.0.6, not on 4.5.

The bug is in Omarchy itself, so if you want I can send the fix upstream to Omarchy too.

…hanges, so a new lock time works without a shell restart

A lock or screensaver timeout changed while the shell runs never fired: the main IdleMonitor never reported idle again until a restart. Patch 0032 (both series) switches the monitor off for 50 ms when firstIdleTimeoutSeconds changes. On a Pixel 8 Pro (Omarchy 4.0.6, quickshell 0.3.2.r7, Hyprland 0.57) the unpatched shell never went idle in 100 s after a change to 30 s; patched, it locked 31 s after the change.
@derekross

Copy link
Copy Markdown
Owner

Thank you, Lef. This is a real find, and I think it is bigger than the description says: after a change of the lock time on a running shell the phone no longer locks by itself at all, until the shell restarts. That is true for Omarchy's own settings too, not only for the page in #866.

What I checked here: both Omarchy packages verify against Omarchy's key, and with 0007 and 0013 applied first, 0032 applies with --fuzz=0 and no offset to Service.qml from 4.5.0-3 and from 4.0.6-1, and the patched files parse. CI skips the real-package run, so that was by hand.

Three things before it can merge:

  1. A run on Omarchy 4.5. Your run was on 4.0.6 with the legacy copy; phones are on 4.5.0-3, and this changes how every phone locks. I'll run it on my Pixel 7 Pro before merging: a fresh shell start still locks after 60 s (the handler also fires while the service starts, so every start now goes through the 50 ms off and on), the bug without the patch, the fix with it, and a change made while the phone is locked and dark. If you update your 8 Pro to 4.5 with omarchy update and post the same four with omarchy-shell idle status before and after, with the shell restarted before each side, that would count just as well.

  2. The legacy copy. legacy-4.0.6/ only takes what a phone needs to get through the update to 4.5; fixes go in patches/ alone. Please drop legacy-4.0.6/0032-…. Your change to test/source-family.py (the pinned list in place of the count) should stay; it's better than what we had.

  3. Where the bug is. I don't think it is in Omarchy's service, which only binds the timeout. Reading Quickshell at the commit our phones run (src/wayland/idle_notify/monitor.cpp, 2b4501a): on a timeout change updateNotification() deletes the old notification, creates the new one, and only then assigns the pointer property that isIdle is bound to. If the new object lands at the old one's address, which is what the allocator tends to do, the property "did not change", the binding is never re-evaluated, and it stays attached to the destroyed object. Switching enabled off and on sends the pointer through null, which is why your patch works and why a monitor that never changes works too. I haven't reproduced it. One log would settle it: start the shell with QT_LOGGING_RULES='quickshell.wayland.idle_notify.debug=true', change the timeout, and compare the address in the "Destroyed" line with the next "Created" line; then see whether "has been marked idle" arrives while idle status still says "idle":false. If so, please say so in the patch header, and the upstream report belongs to Quickshell (clearing the pointer before creating the new object would fix it there). Our patch then stays until a fixed Quickshell is on the phones.

Two notes for the merge: #610 also claims 0.1.49 and also adds a patches/0032-…, and the two conflict in test/source-family.py. I'll sort the numbers out when I merge; whichever goes second becomes 0.1.50 and 0033. And #866 should not merge before this one, since its page is what makes the bug easy to reach.

@Somnius

Somnius commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@derekross thanks for digging into Quickshell, that explanation fits everything I saw.

My 8 Pro is on Omarchy 4.5.0-3 now (updated this evening), with quickshell 0.3.2.r7.g2b4501a-1, the same commit you read. I'll drop legacy-4.0.6/0032-… from the PR, then run the four cases on 4.5 with omarchy-shell idle status before and after and the shell restarted before each side, plus the debug log with QT_LOGGING_RULES='quickshell.wayland.idle_notify.debug=true' to compare the Destroyed and Created addresses. I'll post the results here and put what the log shows into the patch header.

… 4.0.6 legacy copy

legacy-4.0.6/ only carries what a phone needs to get through the update to 4.5.
Somnius added a commit to Somnius/omarchy-mobile that referenced this pull request Nov 18, 2026
…e idle re-arm

A phone that never locks by itself isn't offered one tap away; a 0 set by
hand in shell.json still means no idle lock, and the page says so. depends
names omamobile-omarchy>=0.1.49 (derekross#879, the number is
set at merge): without its re-arm, changing the lock time on a running shell
leaves the phone with no idle lock until the shell restarts.
@Somnius

Somnius commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

@derekross the log settles it, your reading of Quickshell was right. All on my 8 Pro, Omarchy 4.5.0-3, quickshell 0.3.2.r7.g2b4501a-1, Hyprland 0.57.0, kernel 7.3.0-rc6-omamobile-push1-g0124dfcad569. Each run started with a fresh shell from omarchy-launch-shell with QT_LOGGING_RULES=quickshell.wayland.idle_notify.debug=true, nobody touching the phone.

Without the patch (omamobile-omarchy 0.1.47 from the mirror). Shell started at idle.lock 180, changed to 30 at 19:04:35:

Created  IdleNotification(0xffff5a365070) with timeout: 180000
Destroyed IdleNotification(0xffff5a365070)
Created  IdleNotification(0xffff5a365070) with timeout: 30000
IdleNotification(0xffff5a365070) has been marked idle

Same address, and "marked idle" arrives, but omarchy-shell idle status said "idle":false with idle-monitor: active for the whole 67 s I watched, and nothing locked.

With the patch (0.1.49 from this branch, built and installed with tools/phone-install-package). Same start, 30 set at 19:11:35:

Created  IdleNotification(0xffff9eae5b40) with timeout: 180000
Destroyed IdleNotification(0xffff9eae5b40)
Created  IdleNotification(0xffff78ff6ed0) with timeout: 30000
IdleNotification(0xffff78ff6ed0) has been marked idle
idle-monitor: idle   (17:12:05Z)

It locked at 19:12:05, 30 s after the change.

Changed while locked and dark (patched): with the phone locked and the backlight off (bl_power 4), I changed idle.lock to 45 and then unlocked it. It went idle and locked by itself at 19:14:04, with no shell restart.

Still to do: the fresh start with nothing changed (locks after 60 s). The phone locked itself during the last run and the lock screen won't take a PIN typed over SSH, so it waits until I'm at the phone. I'll add it here.

The patch header now says where the bug is and that it can go once a Quickshell that clears the pointer before creating the new notification is on the phones (cadbc90). It's already reported upstream, quickshell-mirror/quickshell#938 and quickshell-mirror/quickshell#1309, and there's an open fix, quickshell-mirror/quickshell#1097, which sets bNotification = nullptr before the delete. So I won't open a new one; I'll add my log there. The header links all three.

@derekross derekross left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Lef. The log settles it: Destroyed and the next Created at the same address, "has been marked idle" arriving, and idle status still saying "idle":false. That is exactly the stale pointer, and the patched run shows the new notification at a different address and a lock 30 s after the change. I read the three upstream links too: issues 938 and 1309 describe this fault and PR 1097 clears the pointer before the delete, so adding your log there is the right move and no new report is needed.

The legacy copy is gone and the pinned list stays, as asked. I ran the package's tests here against the real 4.5.0-3 package, since CI skips that part: the whole series applies (30 patches, fuzz 0) and the patched QML parses.

One case is left, the one you listed as still to do: a fresh shell start with nothing changed, phone left alone, locks at its configured time. It matters more than it looks, because the handler also fires while the service starts, so with this patch every start on every phone goes through the 50 ms off and on. Your patched log shows the monitor being created at start, which is a good sign; I'd like to see it end in a lock. When you are at the phone: restart the shell, note omarchy-shell idle status, leave it, and post when it locked. Please also run journalctl --user -b | grep -i 'binding loop' after that start; a small model of the three lines printed one such warning here, and I'd like to know whether the real service does.

When that is in I'll merge this as 0.1.49, ahead of #610 (which then takes 0.1.50 and 0033), so the omamobile-omarchy>=0.1.49 you put in #866 stays right. The header's last line ("Omarchy 4.5: same hunk, one line of offset") is left over from the 4.0.6 copy; drop it if you push again, otherwise I'll leave it.

Somnius added a commit to Somnius/omarchy-mobile that referenced this pull request Nov 18, 2026
…e idle re-arm

A phone that never locks by itself isn't offered one tap away; a 0 set by
hand in shell.json still means no idle lock, and the page says so. depends
names omamobile-omarchy>=0.1.49 (derekross#879, the number is
set at merge): without its re-arm, changing the lock time on a running shell
leaves the phone with no idle lock until the shell restarts.
@Somnius

Somnius commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@derekross the last case passed. Fresh shell start with the patch (omamobile-omarchy 0.1.49 from this branch, Omarchy 4.5.0-3, quickshell 0.3.2.r7.g2b4501a-1), idle.lock 60, nothing changed, phone left alone:

shell up 21:03:41   idle-monitor: active
Created IdleNotification(0xffff78ac5a80) with timeout: 60000
IdleNotification(0xffff78ac5a80) has been marked idle
idle-monitor: idle  19:04:41Z

It locked at 21:04:41, exactly 60 s after the start. journalctl --user -b | grep -i 'binding loop' gives 0 lines, and the shell's own log for that run (quickshell log, 44 lines) has none either.

So all four are in now: a fresh start locks on time, the bug without the patch, the fix with it, and a change while locked and dark.

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