Repository navigation
Ignore USB Touch Bar DRM when detecting external displays - #11516
hanscnelson wants to merge 3 commits into
Conversation
T1/iBridge Touch Bar enumerates as card*-USB-* and stays connected. The helper treated that as a docked desktop, so undocked lid-close skipped the lock.
|
Reviewed at 07e254f. The bug is real, and What was checked. On a disposable Omarchy worker I built fake DRM trees for the T1 layout in this PR ( The finding. In the kernel, A correction to the description. logind doesn't consult this helper. It counts external displays itself, and only by type: VGA, DVI, DP, HDMI, TV and the like ( Related. #10713 fixes the same lock by switching Second opinion. Codex at medium effort reviewed the diff pinned to this head. It raised the GUD and Asahi cases and the logind point, and I checked each against the kernel and systemd sources before including it here. It also reviewed the three competing PRs and preferred a narrowed version of this one. Its independence from my review isn't guaranteed. Next. This is waiting on you to narrow the exclusion to the Touch Bar. After that, it needs confirming on Touch Bar hardware against the new head: @kutassy's T2 from #10618 as well as your T1. |
|
T2 data for #11516, from a MacBookPro15,2 (Omarchy 4.0.4-1, kernel
Happy to test the narrowed head on this T2. |
DRM_MODE_CONNECTOR_USB also covers GUD USB panels and other real displays, so excluding the connector type hid them as external monitors. The Touch Bar's card is backed by an Apple (05ac) USB device on both T1 and T2, and that vendor ID is readable by the desktop user, unlike the connector's non-desktop property. The vendor is read from the card's device or, when the driver binds an interface as appletbdrm does, from the interface's parent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
I've pushed a33a609 to this branch. It narrows the exclusion so only the Touch Bar is ignored, not every What changed. What was checked. I ran it on a disposable Omarchy worker against fake sysfs trees: the T1 layout from this PR ( Second opinion. Codex Medium reviewed it in two rounds, pinned to the head each time. In the first round it pointed out that a driver bound to the whole USB device would put Next. This needs confirming on real Touch Bar hardware at this head. @kutassy (T2) and @hanscnelson (T1), could you run it as your desktop user, with no external display attached? curl -fsSL https://raw.githubusercontent.com/hanscnelson/omarchy/a33a609869e82ccef6a645186b5163037338aab1/bin/omarchy-hw-external-monitors -o /tmp/hw-external-monitors
bash /tmp/hw-external-monitors; echo $?It should print |
[Medium impact] The PR appears safe to merge. SummaryThe PR excludes Apple USB Touch Bar connectors from external-monitor detection while keeping other connected displays eligible.
Reviews (2) · Last reviewed commit: "Merge quattro and move the Touch Bar tes..." · Reviewed by Greptile |
|
Tested a33a609 on the MacBookPro15,2 (T2), as the desktop user, no external display attached: The installed 4.0.4 helper returns One correction to my earlier data: the card index isn't stable. I haven't tested the DP/HDMI-attached case yet. I'll follow up with that once I can dig out an external monitor. |
|
Thanks @kutassy. That T2 result is the confirmation this fix was waiting on, and your note on the alternating card index matters too: the helper finds the card from each connector's name every time it runs, so What was checked at a33a609. On a fresh disposable Omarchy worker, against What's left. The record that marks a fix verified needs the confirmation to name the full commit, and your comment says |
|
Tested New helper exits Happy to repeat with a physical monitor if you'd prefer. |
|
Thanks @kutassy. The attached-display run closes the other half: with the Touch Bar on One thing still missing. A hardware fix is recorded as verified only from a confirmation that names the full commit, and both of your results say Competing fixes. Claude Opus 5.5 and Codex Medium each compared this PR with #10713 and #12682, Codex without seeing my answer. Both preferred this one. The other two change only the lid-close lock, so Next. This is waiting on the full-SHA confirmation above. After that, it's the maintainer's decision. |
|
Confirmed on MacBookPro15,2 (T2, Omarchy 4.0.4) at a33a609: exits 1 undocked, 0 with DP attached. |
|
Thanks @kutassy. That confirmation names the full head, a33a609, so this fix is now recorded as verified: the T2 Touch Bar no longer counts as an external display, and a real DP output still does. What was checked. The head hasn't moved since the worker run described above (a T2-shaped sysfs tree reproduces the bug on Next. Nothing is left for the author. This is waiting on the maintainer, who also chooses between this and the competing approaches in #10713 and #12682. A T1 result from @hanscnelson at the same commit would still be welcome, but it isn't blocking. |
|
Confirmed on MacBookPro14,2 (T1, Omarchy 4.0.4, undocked) at a33a609: the helper exits 1. card0-USB-1 is connected, DP and HDMI are disconnected, and Hyprland lists only eDP-1. No external display was attached for this run. |
quattro folded hw-external-monitors-test.sh into hw-display-test.sh (omacom#16337), so the Touch Bar cases move there. Three of the eight are dropped as covered by the rest: the standalone and T1 interface-bound Touch Bar cases exercise the same interface lookup as the T2 case, and a disconnected Touch Bar beside HDMI was already ignored by the status check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This stopped merging after #16337 deleted I kept five of the eight cases: a T2 Touch Bar bound at its USB interface, a Touch Bar bound to the whole USB device, DP beside a Touch Bar, a non-Apple GUD USB display, and a USB connector with no device behind it. I dropped three because other cases already exercise the same paths. The standalone and T1 interface-bound Touch Bar cases use the same interface lookup as the T2 case, and a disconnected Touch Bar beside HDMI was already skipped by the status check. I ran these on a worker built from the Omarchy ISO. With the fix reverted, the T2 case fails. At this head, Codex Medium and muse-wonder (pi, thinking high) reviewed the merge and the fix and found no defects. Both said the dropped cases leave no gap and that GUD, DisplayLink and DP-alt displays still count as external. That is agreement, and independence is not guaranteed. #14994 still competes with this. Earlier triage picked this one because it came first and has no defect that #14994 avoids, and neither pull request has changed since. One small thing for you: the description still names This is now waiting on the maintainer. |
|
Omarchy 4.5.0-3 (tag The package update replaced a locally installed copy of This is the lock-classification bug. The dark strip after S3 on the same update is t1bridge 0.1.12, reported on standardagents/t1bridge#18. |
|
Retested on head
Same results as on |
Summary
omarchy-hw-external-monitorswalks/sys/class/drm/card*-*/statusand treats every connected connector that is noteDP/LVDS/DSIas a desktop display.On a T1 MacBook the Touch Bar is a real DRM device (
card0-USB-1, alwaysconnected,ID_SEAT=seat-touchbar). Hyprland does not list it as a monitor. The helper still returned true with no HDMI/DP attached, so:omarchy-system-lid-closeskipped the lock (lid closed && ! external)omarchy-hw-clamshellwas true whenever the lid was shutHandleLidSwitchDocked=ignore)Reproduced on MacBookPro14,2 (Omarchy 4.0.3, T1Bridge Touch Bar). With a local override of this helper, undocked lid-close locks immediately. A real DP/HDMI dock still counts.
This does not change lid-open bindings or suspend/resume backlight. A long lid-close that actually reaches S3 can still take a while to light the panel; that is separate.
Test plan
bash test/shell.d/hw-external-monitors-test.sh(existing cases plus USB-1 alone, split-card eDP+USB, DP still found with Touch Bar, HDMI still found)bash test/shell.d/lid-close-test.shDP-*/HDMI-*/DVI-*, notUSB-*Fixes #10618