Skip to content

Ignore Hyprland FALLBACK in external-monitor checks - #10586

Closed
crwirth wants to merge 1 commit into
omacom:quattrofrom
crwirth:fix/10584-exclude-fallback-monitor
Closed

crwirth wants to merge 1 commit into
omacom:quattrofrom
crwirth:fix/10584-exclude-fallback-monitor

Conversation

@crwirth

@crwirth crwirth commented Sep 7, 2026 •

Copy link
Copy Markdown

Summary

Fixes #10584.
Fixes #10935.

When the internal panel is soft-disabled (omarchy-hyprland-monitor-internal off) and the external cable is unplugged, Hyprland/aquamarine creates a synthetic FALLBACK headless output so it is never left with zero monitors.

omarchy-hyprland-monitor-external-active only excluded laptop connector name prefixes (eDP/LVDS/DSI). FALLBACK matched as an "active external", so omarchy-hyprland-monitor-internal recover() returned early and never cleared internal-monitor-disable — black screen until manual recovery.

Change

select(.name != "FALLBACK")

added to the jq filter in bin/omarchy-hyprland-monitor-external-active.

User-created headless outputs (hyprctl output create headless → HEADLESS-*) still count as active externals; only Hyprland's own FALLBACK is excluded.

Evidence

Bug reproduced (pre-fix filter)

[{"name":"eDP-1","disabled":true},{"name":"FALLBACK","disabled":false}]

Old filter → external-active = true (FALLBACK fools it).
Matches the issue's live socket2 capture after monitorremoved>>HDMI-A-1.

Fix validated

NEW filter on same JSON → external-active = false
NEW filter with live HDMI → external-active = true
NEW filter with HEADLESS-1 → external-active = true

bash test/shell.d/monitor-external-active-test.sh
ok - external-active helper excludes the synthetic FALLBACK monitor
ok - external-active is true with a live HDMI output
ok - external-active is false when only FALLBACK remains after unplug
ok - external-active is false for FALLBACK alone
ok - external-active is false for internal-only
ok - external-active ignores disabled external outputs
ok - external-active still counts a user-created headless output

bash test/shell.d/monitor-recovery-test.sh
# still green, including FALLBACK exclusion assert

Test plan

  • jq pre/post filter on FALLBACK-only JSON
  • bash test/shell.d/monitor-external-active-test.sh (incl. HEADLESS-1 pin)
  • bash test/shell.d/monitor-recovery-test.sh
  • Counter-check: ^HEADLESS- exclusion keeps old cases green and turns the new case red
  • Manual laptop: internal off + external unplug → eDP re-enables (no black FALLBACK)

Fixes #13741

Fixes #8027

Fixes #7209

@BigTorro

Copy link
Copy Markdown

Hit the same bug independently in #11654, which I'm closing in favour of this PR. Two data points that may help review:

  • It also happens across suspend/resume, not only on unplug: after a resume the clamshell sync disabled the panel, then FALLBACK appeared and the screen stayed black until reboot.
  • Matching the name is as reliable as Hyprland's own check: in 0.56.2 it is State::FALLBACK_OUTPUT_NAME (src/state/FallbackState.hpp), and CFallbackStateKeeper recognises its output by comparing m_name == "FALLBACK". hyprctl monitors -j exposes no other way to tell it apart.

@BigTorro BigTorro left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checked this on a scratch copy: green on the PR head and on current quattro (applies cleanly), and removing the FALLBACK exclusion turns external-active is false when only FALLBACK remains after unplug red, so the test does guard the fix.

One gap worth closing: nothing pins that a headless output created with hyprctl output create still counts as a display, which is the concern raised on #11654 and the behaviour a ^HEADLESS- exclusion like the one suggested in #10935 would change. With such an exclusion added as its own select, both monitor-external-active-test.sh and monitor-recovery-test.sh stay green; the case suggested inline turns red.

#10935 reports the same bug, so Fixes #10935 next to Fixes #10584 would close both.

When every real output is gone or soft-disabled, Hyprland invents a
synthetic FALLBACK headless monitor. omarchy-hyprland-monitor-external-active
treated that head as a live external display, so recover() short-circuited
after unplug and the internal panel stayed disabled (black screen).

Exclude name == FALLBACK from the active-external filter so unplug can
clear internal-monitor-disable and re-enable the laptop panel. User-created
HEADLESS-* outputs still count as active externals.

Fixes #10584
Fixes #10935

Signed-off-by: fresh3nough <[email protected]>
@crwirth
crwirth force-pushed the fix/10584-exclude-fallback-monitor branch from 4abb4cc to 6bfd273 Compare September 18, 2026 23:09
@crwirth

crwirth commented Sep 18, 2026

Copy link
Copy Markdown
Author

Rebased onto current quattro and squashed to a single DCO + SSH-signed commit (6bfd2733).

Incorporated review feedback already on the branch:

Tests re-run green after rebase:

  • bash test/shell.d/monitor-external-active-test.sh
  • bash test/shell.d/monitor-recovery-test.sh

Notes from the new confirmations on #10584 / #11654:

  • Same failure path on suspend/resume when clamshell leaves the panel disabled and FALLBACK appears
  • Hyprland 0.56.2 identifies the placeholder via State::FALLBACK_OUTPUT_NAME / name == "FALLBACK", so the name filter matches the compositor's own check
  • Intentionally not excluding HEADLESS-* (narrower than the DRM-connector approach in closed Recover the laptop panel when the external monitor disappears #11654)

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and tested on a disposable Omarchy VM running Hyprland 0.56.2, at 6bfd2733c. The bug is real and this fixes it. Disabling the VM's only monitor the way omarchy-hyprland-monitor-internal off does makes Hyprland add FALLBACK. With quattro's helper, omarchy-hyprland-monitor-internal recover then sees an "active external monitor" and leaves the panel off; with this branch's helper it clears the toggle and the monitor comes back. Taking the FALLBACK line back out of the helper brings the bug back. A headless output created with hyprctl output create headless still counts as external, as before.

./test/cli passes, and so do both test/shell.d/monitor-* files this touches. The full shell suite has three failures (ascii-test.sh, omarchy-kernel-migration-test.sh, branding-about-animation-test.sh), and all three fail the same way on the commit this branch is based on, so none comes from this change.

Codex at medium effort reviewed it as a second opinion and found no defect. It notes that the two grep -F 'select(.name != "FALLBACK")' assertions only check the text is present, but the new test also runs the helper against stubbed hyprctl output, so the fix is covered by behaviour and not just by a string. I pushed nothing.

Two other open pull requests fix the same bug: #12616 asks the kernel whether each output has a DRM connector, and #13749 excludes FALLBACK the same way this one does. Asked to compare all three without being told my view, Codex picked this one, and I agree, though its independence from my reasoning is not guaranteed. This is the smallest change that fixes the bug, it is the oldest, and its tests also pin that a headless output created on purpose still counts. #12616 stops counting those as well, which is a behaviour change the bug does not need.

I linked #13741 and #8027, which describe the same failure, so they close with this. It now waits on the maintainer.

@sedubois

sedubois commented Oct 9, 2026

Copy link
Copy Markdown

Confirming this on real hardware: TUXEDO InfinityBook Pro 14 Gen10 (AMD), Omarchy 4.0.4, Hyprland 0.56.2.

I hit it twice in normal use, with the panel turned off through Menu → Trigger → Laptop display while a USB-C monitor was attached:

  • Unplugging the monitor left no screen at all, and the machine looked frozen.
  • Unplugging it while the laptop was suspended gave a black screen on resume.

Reproduced without a monitor:

hyprctl output create headless
omarchy-hyprland-monitor-internal off
hyprctl output remove HEADLESS-n
  • Unpatched: hyprctl monitors all is left with eDP-1 disabled and only FALLBACK enabled. omarchy-hyprland-monitor-watch runs omarchy-hyprland-monitor-clamshell, but external-active counts FALLBACK, so the panel stays off.
  • With this PR's external-active on PATH: in the same stuck state, omarchy-hyprland-monitor-clamshell turns eDP-1 back on and clears internal-monitor-disable.lua.

@omarchybot

Copy link
Copy Markdown
Collaborator

Closing this in favour of #13749, which has merged into quattro with the same fix: omarchy-hyprland-monitor-external-active now excludes Hyprland's FALLBACK placeholder output, so the laptop screen is turned back on when the last external monitor is unplugged. The issues this pull request names are closed with it.

Closed at the maintainer's request after #13749 merged; Claude Opus 5.5 compared the two diffs, and no second-opinion review was run on that comparison. Thank you for the fix and the test.

@omarchybot omarchybot closed this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

4 participants