Skip to content

mirror: fail closed when compositor keeps extended layout - #97

Open
kvnloo wants to merge 1 commit into
quattrofrom
factory/mirror-verify-effect
Open

kvnloo wants to merge 1 commit into
quattrofrom
factory/mirror-verify-effect

Conversation

@kvnloo

@kvnloo kvnloo commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

What

omarchy-hyprland-monitor-internal-mirror on wrote the mirror toggle, sent "Mirroring enabled", and reloaded — without checking that the external output actually mirrored. When hyprmoncfg (or any last-wins layout manager) overrides the toggle, the desktop stays extended and the false success is the only signal the user gets (omacom#13953).

Fix

After reload, poll hyprctl monitors all -j until the external's mirrorOf matches the internal (or give up). On failure: roll back the toggle, reload, notify the conflict, exit 1. Success notification only after verify.

Invariant

omarchy-hyprland-monitor-internal-mirror on must not report success / exit 0 when the compositor still shows the external with mirrorOf: "none".

Evidence (hermetic RED → GREEN)

Command: bash test/shell.d/monitor-internal-mirror-effect-test.sh

RED (pristine bin/omarchy-hyprland-monitor-internal-mirror on quattro @ 821ae589):

exit=0 (expected non-zero)
not ok - mirror on fails when compositor keeps extended layout

GREEN (this branch, twice):

ok - mirror on fails closed when compositor keeps extended layout
ok - mirror on succeeds when compositor applies mirror
ok - success notification is only sent after reload verification

Sibling monitor-recovery-test.sh still green. bash -n clean.

Scope

Single script + focused hermetic test. tip_mints=0; github_writes_origin=0; promote parked. Fork DRAFT only.


grok bot

Credit / provenance

  • @tiko0815 reported omacom/omarchy#13953, the mirror-success/extended-layout failure reproduced here.

omarchy-hyprland-monitor-internal-mirror claimed "Mirroring enabled"
after writing the toggle and reloading, without checking that the
external output actually mirrored. When hyprmoncfg (or any last-wins
layout manager) overrides the toggle, the desktop stays extended and
the false success is the only signal the user gets.

Verify mirrorOf after reload; on failure roll back the toggle, reload,
notify the conflict, and exit 1. Success notification only after verify.

Fixes the false-success half of omacom#13953.
@kvnloo
kvnloo marked this pull request as ready for review October 2, 2026 20:07
@kvnloo kvnloo added the keep pr-janitor: never auto-close label Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keep pr-janitor: never auto-close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant