Skip to content

Keep the lid inhibitor through DPMS blanks on HDMI and DisplayPort displays - #17895

Open
poltak wants to merge 1 commit into
omacom:quattrofrom
poltak:fix/lid-inhibit-counted-displays-dpms
Open

poltak wants to merge 1 commit into
omacom:quattrofrom
poltak:fix/lid-inhibit-counted-displays-dpms

Conversation

@poltak

@poltak poltak commented Nov 6, 2026

Copy link
Copy Markdown

What changes

A docked laptop with its lid closed suspends 5 s after every lock (#15207). The lock screen's idleBlankTimer sends DPMS off, and DPMS off makes a DisplayPort or HDMI connector read enabled=disabled in sysfs. logind counts an external display only while its connector reads enabled, so it switches to Docked=false and the closed lid suspends the machine.

omarchy-system-lid-inhibit already holds logind's handle-lid-switch inhibitor for displays that logind does not count, but it looked only at USB, Unknown, DVI-A and Composite connectors. Its comments already say that a display blanked by DPMS should keep a closed laptop awake. This change makes it do that for HDMI and DisplayPort too: every connected connector except eDP, LVDS and DSI counts as external.

Nothing else changes:

  • The inhibitor is still held only while Hyprland has the output enabled. A monitor switched off in the monitor config still takes no inhibitor.
  • It still applies only on laptops, and only when HandleLidSwitchDocked=ignore.
  • Unplugging the display still releases it.

It does not cover logout or the greeter, because the inhibitor is bound to the graphical session. #13778 covers that case with a system service. This PR does not replace it.

Verification

  • bash test/shell.d/lid-inhibit-test.sh: all pass. The old case "HDMI and DisplayPort displays, which logind counts, take no inhibitor" checked the behaviour this PR changes, so I replaced it with "a DisplayPort display takes the inhibitor". That case fails with the script on quattro and passes with this change.
  • bash test/shell.d/lid-close-test.sh: passes.
  • On a MacBook Pro 14" M2 Max (Omarchy 4.5.0-3, systemd 262.1), Samsung monitor on DP-3, lid closed, on AC:
    • Without the change: locking suspended the machine 6 s later (journal: lock 17:09:14, display off 17:09:19, Suspending... 17:09:20).
    • With the patched script: it took the inhibitor, I locked, the display blanked, and logind read Docked=false from 10 s on. Nothing suspended in 45 s, and the journal had no suspend entry.
  • Not checked: Intel Touch Bar Macs and the other drivers in Docked laptop with lid closed suspends after every lock: lock-screen blank makes logind treat external displays as undocked #15207. The Touch Bar's USB connector was already in the old list, so this change does not affect it.

Screenshots

No visible change: it changes when a logind inhibitor is held.

Closes #15207

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Extends the lid inhibitor to connected external displays, including HDMI and DisplayPort.

  • Connected external displays keep the lid inhibitor active while DPMS blanks them.

Reviews (2) · Last reviewed commit: "Keep the lid inhibitor through DPMS blan..." · Reviewed by Greptile

@nitroCode777

Copy link
Copy Markdown

Thanks for picking this up! This is the fix I proposed in #15207 (point 1 of my comment), and your version goes one step further: since every connected non-internal connector now counts as external, the inhibitor is already held when the dock is plugged in, before the lock's blank. That also makes the ordering concern from my point 2 moot, so no separate change is needed there.

It should cover my setup too, since none of its outputs are eDP, LVDS or DSI: DisplayLink DVI-I-1 / DVI-I-2 (evdi) and nvidia-open HDMI-A-1. There the blank cleared enabled on all three, as I reported in #15207. I can test the patched script on that machine if it helps.

Since the fix builds on the analysis and proposal in #15207, would you mind adding me as co-author on the commit?

Co-authored-by: nitroCode777 <260935085+nitroCode777@users.noreply.github.com>

…splays

- The lock screen blanks displays with DPMS 5 s after it locks.
- DPMS off makes an HDMI or DisplayPort connector read disabled, so logind counts the laptop as undocked and suspends a closed lid.
- omarchy-system-lid-inhibit now treats every connected connector except eDP, LVDS and DSI as external, so it holds the handle-lid-switch inhibitor for these displays too.

Refs omacom#15207.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: nitroCode777 <260935085+nitroCode777@users.noreply.github.com>
@poltak
poltak force-pushed the fix/lid-inhibit-counted-displays-dpms branch from 0ab7bd2 to 0aeccde Compare November 14, 2026 06:50
@poltak

poltak commented Nov 14, 2026

Copy link
Copy Markdown
Author

Since the fix builds on the analysis and proposal in #15207, would you mind adding me as co-author on the commit?

For sure. I didn't really do anything here 😂 thanks for your fix proposal here!

You're added in

@omarchybot

Copy link
Copy Markdown
Collaborator

Codex (GPT-6; reasoning effort not exposed) read the diff, discussion, linked issue #15207, and the base branch guidance. My classification is bug, but the configured classification model, deepseek-v4p1-flash, returned no valid class, so classification remains unsettled.

Worker verification and a second opinion on the fix have not run. This waits for classification to be settled before verification can proceed.

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.

Docked laptop with lid closed suspends after every lock: lock-screen blank makes logind treat external displays as undocked

3 participants