Skip to content

Exclude Touch Bar DRM outputs from laptop panel detection - #17835

Open
guirossibrum wants to merge 1 commit into
omacom:quattrofrom
guirossibrum:fix/touchbar-panel-detection
Open

guirossibrum wants to merge 1 commit into
omacom:quattrofrom
guirossibrum:fix/touchbar-panel-detection

Conversation

@guirossibrum

Copy link
Copy Markdown

Bug and resulting behavior

On an Apple Silicon MacBook Pro, the Touch Bar can appear as a DSI-* output before the real laptop eDP-* panel. omarchy-hyprland-monitor-laptop currently returns the first eDP/LVDS/DSI-looking output, so docked lid-close handling can disable the Touch Bar while leaving the laptop screen on.

Exclude only confirmed Touch Bar outputs from laptop-panel selection, using the parent DRM card's DRIVER=adp or DRIVER=appletbdrm in device/uevent. Preserve the existing candidate order for real panels. A genuine DSI panel, missing/unknown sysfs evidence, or a connector name shared with a non-Touch-Bar card retains the existing fallback. Disabled laptop panels remain discoverable for lid-open recovery. There are no hard-coded card numbers, panel names or MacBook model IDs.

Existing clamshell/lid logic then targets the real panel. With a real external monitor, closing the lid disables the laptop panel; reopening restores it. Without an external display, the Touch Bar does not create a false clamshell condition, and existing locking/logind suspend policy applies.

Small deployment boundary

Only one runtime shell script changes. No package/build dependency, compiler, daemon, new polling loop, configuration migration or Touch Bar animation integration is required. Driver parsing uses Bash builtins. Normal Omarchy delivery replaces the script; there is no on-machine build step. README and the short detection document describe the behavior and limits.

This is independent of #17826. Related #11516 addresses the different Intel/USB Touch Bar external-display predicate; this PR changes only laptop-panel selection and does not blanket-exclude real USB displays or genuine DSI panels.

Validation

Five focused suites passed 100 assertions:

  • hw-display-test.sh: 33, including the real laptop→external predicates→lid/clamshell chain.
  • monitor-clamshell-scale-test.sh: 33.
  • monitor-output-name-test.sh: 8.
  • lid-close-test.sh: 6.
  • lid-inhibit-test.sh: 20.

The new regression fails on the previous helper: expected eDP-1, actual DSI-1. Cases include Touch Bar first, disabled panel, both driver names, genuine/unknown DSI, missing sysfs, ambiguous same-name cards, Touch Bar only, docked close, reopen, and undocked close. Metadata for 579 commands, shell syntax and whitespace checks pass. Separate QA and code review passed.

Live M1 evidence: /sys/class/drm/card1-DSI-1 is connected and its card reports DRIVER=adp; the real eDP card reports DRIVER=apple-drm. The new helper selects eDP-1 against the actual sysfs tree with a Touch Bar-first compositor fixture. The live open-lid compositor currently lists eDP-1 and external DP-2, and read-only selection returns eDP-1.

Hardware limit: this computer still has the earlier local panel override and an independent Touch Bar lid-event guard. Nothing installed or in user configuration was changed during qualification. No physical lid-cycle or suspend qualification of this patch is claimed. Those local workarounds are not included in the PR.

Prepared with Codex assistance.

@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

omarchy-hyprland-monitor-laptop skips outputs only when every matching DRM card reports adp or appletbdrm.

  • Lid handling now picks the real panel when a Touch Bar appears first.

Reviews (1) · Last reviewed commit: "Exclude Touch Bar DRM outputs from lapto..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 in Codex (reasoning effort not exposed) read the diff and the laptop-panel, lid-close, clamshell and mirroring callers. I classified this as a hardware compatibility fix, but deepseek-v4p1-flash returned no usable classification, so the required classification agreement is missing.

This pass stops pending classification review. No worker tests or code-review second opinion ran, and no labels or branch changes were applied. The physical lid-cycle limitation described in the PR remains unverified.

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Nov 22, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 in Codex (reasoning effort not exposed) reviewed the panel helper and its clamshell, manual-disable, mirroring and lid-close callers. Opus 5.5 High and muse-wonder via pi (thinking high) also reviewed the patch and found no actionable defect in the selection helper; their agreement does not guarantee independence. Opus also noted that Apple Silicon reads lid state through logind, which the ACPI fixtures do not exercise.

On a disposable Omarchy worker, all 129 CLI checks and 100 assertions across the display, clamshell-scale, monitor-name, lid-close and lid-inhibit suites passed. My additional Touch Bar-first fixture selected DSI-1 on the base helper, eDP-1 on this head, and DSI-1 again with the fix reverted. These are software fixture results; the worker has no Touch Bar hardware.

This still needs an affected issue reporter or a maintainer to confirm commit e8e5fb782c2bde049b2274a04ed24c3dea4b15da on the affected MacBook, without the local panel override or separate lid-event guard masking the result. Please check that docked lid-close disables the laptop panel while keeping the external display usable, reopening restores the panel, and undocked lid-close still locks and follows the normal suspend policy. To activate that exact head on a test install:

git clone --single-branch --branch quattro https://github.com/omacom/omarchy.git ~/omarchy-pr-17835
git -C ~/omarchy-pr-17835 fetch origin pull/17835/head
git -C ~/omarchy-pr-17835 switch --detach e8e5fb782c2bde049b2274a04ed24c3dea4b15da
omarchy dev link ~/omarchy-pr-17835

Reboot into the linked checkout before testing, and report the full SHA and those three results, along with hyprctl monitors all -j, the parent DRM cards’ device/uevent driver entries, and the helper’s output with the panel enabled and disabled. Physical lid-cycle confirmation remains outstanding.

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.

2 participants