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.

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.

2 participants