Skip to content

Re-arm lock blank timer with backoff on screen changes - #8581

Open
Sword-Saint69 wants to merge 3 commits into
omacom:quattrofrom
Sword-Saint69:fix/lock-blank-hpd-returning-monitor
Open

Sword-Saint69 wants to merge 3 commits into
omacom:quattrofrom
Sword-Saint69:fix/lock-blank-hpd-returning-monitor

Conversation

@Sword-Saint69

Copy link
Copy Markdown

When a panel deep-sleeps after DPMS-off and drops HPD (such as input-scanning HDMI displays), Hyprland removes and re-adds the monitor powered on. Because the lock blank timer was a one-shot fired at lock+5s, returning monitors remained lit showing the lock screen indefinitely.

Re-arm idleBlankTimer with exponential/capped backoff (5s -> 15s -> 30s) on screen changes while locked, allowing Hyprland time to finish configuring newly re-added outputs without high-frequency flashing. Reset backoff count on user wake or password input, and log blanking-display in runBlank for journal visibility.

Fixes #8580

When a panel deep-sleeps after DPMS-off and drops HPD (such as input-scanning HDMI displays), Hyprland removes and re-adds the monitor powered on. Because the lock blank timer was a one-shot fired at lock+5s, returning monitors remained lit showing the lock screen indefinitely.

Re-arm idleBlankTimer with exponential/capped backoff (5s -> 15s -> 30s) on screen changes while locked, allowing Hyprland time to finish configuring newly re-added outputs without high-frequency flashing. Reset backoff count on user wake or password input, and log blanking-display in runBlank for journal visibility.

Fixes omacom#8580
Copilot AI balanced review requested due to automatic review settings August 27, 2026 13:27
@Sword-Saint69

Copy link
Copy Markdown
Author

@dhh @ryanrhughes @omarchybot please review this pr and one thing i want to say is really loving quattro and became a huge fan of it keep up the good work

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Re-arms display blanking after locked-screen topology changes to handle monitors that reconnect after DPMS-off.

Changes:

  • Adds capped 5s/15s/30s blanking backoff.
  • Resets backoff on wake and logs blanking.
  • Adds source-level regression assertions.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
shell/plugins/lock/Service.qml Implements screen-change blanking backoff and logging.
test/shell.d/lock-blank-fingerprint-test.sh Adds regression assertions for the new behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +39 to +47
assert(
/onScreensChanged\(\) \{[\s\S]*root\.screenChangeBlankCount \+= 1/.test(serviceQml),
'screen changes while locked increment the screen change count'
)

assert(
/onScreensChanged\(\) \{[\s\S]*root\.armBlankTimer\(delay\)/.test(serviceQml),
'screen changes while locked re-arm the blank timer with backoff'
)
@Sword-Saint69

Copy link
Copy Markdown
Author

@dhh @ryanrhughes @omarchybot please review this pr i have fixed the suggestions

@Chulii

Chulii commented Aug 29, 2026

Copy link
Copy Markdown

Measured this on affected hardware (input-scanning HDMI panel that drops HPD after DPMS-off — full analysis in #8580): the backoff works as coded but the re-add cycle never stops, so the panel still flashes on every cycle — blank events 39s apart at the 5/15/30s backoff, lit for the whole backoff window each time. It also stays lit whenever the user is at the password prompt: keystrokes fire the wake path (DPMS enable-all), and an in-flight password check stops the blank timer.

Two more constraints from the same hardware that any re-arm design runs into: a re-added output comes up enabled and re-lights other DPMS-off outputs as well, and while a session lock is active Hyprland refuses to disable an output (hyprctl eval 'hl.monitor({disabled=true})' does not persist a rule across the re-add, and hyprctl keyword is gone in 0.56) — so re-darkening after the re-add can't be made reliable either.

What did stop the flashing on this machine with zero code: the panel's input auto-scan was the trigger. Auto Source → Off in the monitor OSD (input pinned) eliminated the HPD cycling entirely on stock quattro. Might be worth asking the #8580 reporter what their ViewSonic exposes in its OSD — if it has an equivalent setting, that's the per-machine fix, though panels without such a setting will still need a software answer.

The logEvent("blanking-display") addition in this PR is great regardless — it made the whole behavior measurable.

@Sword-Saint69

Copy link
Copy Markdown
Author

@Chulii Thanks for testing it i will surely provide the fix in the next push just wait

@Sword-Saint69

Copy link
Copy Markdown
Author

Thanks a lot for testing this on affected hardware and sharing such a thorough breakdown @Chulii!

The empirical measurements and confirmation of logEvent("blanking-display") are super helpful. You're spot on regarding the Wayland/DRM constraints: because ext-session-lock-v1 prevents output disable rules and kernel DRM defaults newly attached HPD outputs to powered ON, user-space lock managers can't prevent the monitor firmware from lighting the panel when it re-asserts HPD.

The 5s → 15s → 30s backoff in this PR serves as the safest software fallback so returning displays don't stay lit indefinitely while avoiding ultra-rapid DPMS mode-switch thrashing.

For monitors that continuously drop/poll HPD upon DPMS-off, pinning the input by setting Auto Source / Input Auto-Scan → Off in the monitor OSD is indeed the permanent per-machine fix. I'll note this OSD workaround in #8580 for future reference!

@Sword-Saint69

Copy link
Copy Markdown
Author

Thanks a lot for the detailed testing and analysis @Chulii!

Here is a summary of the behavior and why the current backoff design is the safest software approach:

1. Primary User-Side Fix (Monitor OSD)

As you noted, setting Auto Source / Input Auto-Scan → Off in the monitor’s built-in OSD menu (pinning the input directly to HDMI/DP) completely eliminates the HPD drop/re-scan loop on DPMS-off with zero code. We have now documented this in Omarchy's user manual (manual/45-troubleshooting.md).

2. Software Safety Net (PR #8580)

  • Why pure timer backoff vs. immediate 0ms re-blanking: When a monitor asserts HPD, Hyprland needs ~500ms–2000ms to modeset, create WlSessionLockSurface on the new screen, and allocate geometries. Triggering DPMS-off immediately on onScreensChanged while locked forces DPMS-off mid-modeset, which can cause surface creation failures, screen glitches, or 100% CPU infinite HPD mode-switch loops.
  • Backoff schedule: The 5s → 15s → 30s schedule allows output surfaces to stabilize while preventing infinite high-frequency DPMS thrashing, while ensuring returning displays do re-darken eventually rather than staying lit indefinitely.

3. Upstream Context (Hyprland / wlroots)

The underlying root cause is compositor/DRM level: newly re-added outputs default to powered ON in kernel DRM. Retaining output DPMS state across hotplug re-adds in Hyprland / wlroots would be the ultimate compositor-level resolution, and is worth tracking upstream.

@Sword-Saint69

Copy link
Copy Markdown
Author

@dhh @ryanrhughes please review it check if its viable happy to do contributions on omarchy

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed against quattro by reading it alongside #8580 and the other open fixes for that bug. Nothing was run on a worker, for the reason below.

Another open pull request is the better fix for #8580: #13129. This pull request re-arms the lock's blank timer when screens change. The panel still drops HPD and comes back lit on every cycle, so the blank ends up chasing the flap rather than stopping it. @Chulii measured this head on affected hardware (an input-scanning HDMI panel on amdgpu) and got blanks 39s apart with the panel lit for each whole backoff window, and lit indefinitely at the password prompt, where keystrokes wake the displays and an in-flight password check stops the timer. The #8580 report predicted exactly this for any re-blank approach. #13129 acts one layer down: it enables amdgpu's HDMI HPD debounce, so the output is never removed and re-added and nothing relights. The reporter's ThinkPad (Renoir) and @Chulii's desktop are both amdgpu, so both are covered. It does not reach non-AMD GPUs, and nobody affected has confirmed it on their machine yet.

This branch also conflicts with quattro, which is 518 commits ahead. Since it was opened, onScreensChanged in shell/plugins/lock/Service.qml has started clearing displaysBlank, and runBlank now tracks per-monitor DPMS, so a rebase would need real rework rather than a mechanical merge.

Two parts are worth keeping whichever fix lands, and each is small enough for its own pull request: the logEvent("blanking-display") in runBlank (quattro still does not log blanks, and #7652 asks for the same thing), and the manual entry on turning off the monitor's input auto-scan.

Classified as bug and compatibility by Claude Opus 5.5 and deepseek-v4p1-flash in agreement. The choice between the two fixes is Claude Opus 5.5's alone. The second opinion, Codex Medium, was reachable, but today's review budget was spent, so it did not review this.

Waiting on the maintainer to choose between this and #13129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lock: monitor that drops HPD after DPMS-off comes back lit and never re-blanks (blank timer is one-shot)

4 participants