Skip to content

Fix ASUS ExpertBook B9406 touchpad quirk never being applied - #6388

Open
dhh wants to merge 3 commits into
quattrofrom
fix-b9406-touchpad-quirks
Open

dhh wants to merge 3 commits into
quattrofrom
fix-b9406-touchpad-quirks

Conversation

@dhh

@dhh dhh commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Ports #6093 to quattro, with the fix mechanism changed. Original diagnosis and hardware verification by @mijuny.

On a fresh install of an ASUS ExpertBook B9406 the touchpad is dead: clicks register but the cursor never moves. The quirk from #5435 that masks the pad's bogus pressure axes never took effect.

Why it never applied

libinput scandirs /usr/share/libinput for *.quirks and additionally reads the single file /etc/libinput/local-overrides.quirks. It never scans /etc. The quirk was written to /etc/libinput/asus-expertbook-b9406.quirks, so it was silently ignored.

Verified against the installed libinput rather than taken from docs: built a probe against libinput.so, pointed LIBINPUT_QUIRKS_DIR at a copy of the data dir, and dropped in a deliberately malformed file under a name libinput does not ship. libinput failed quirks loading — proving it reads any *.quirks in that directory, not a fixed list.

Drop-in rather than appending to local-overrides

#6093 appends to local-overrides.quirks. That works, but it is the one file users edit by hand, and a shared file can only be updated idempotently by grepping for a section we already wrote — which silently pins the first version we ever shipped. If the quirk ever needs correcting, the grep matches the stale section and the fix never lands.

A drop-in at /usr/share/libinput/99-omarchy-asus-b9406-touchpad.quirks is a file we own outright, rewritten wholesale on every run. Consistent with how fix-z13-touchpad.sh owns its udev rule, and with the /usr/share/fontconfig/conf.avail, /usr/share/xdg-terminal-exec and /usr/lib/chromium drop-ins already shipped elsewhere.

MatchUdevType

Dropped, as in #6093: the pad's event node is tagged ID_INPUT_MOUSE, so a touchpad constraint skips the section. Bus, vendor, product and DMI already pin the device exactly, so the widened match is inert on any other hardware.

Worth flagging honestly: this claim sits uneasily with the original diagnosis, since the "Touch jump detected and discarded" message comes from libinput's touchpad backend, which only runs on devices tagged as touchpads. Most likely the pad exposes several event nodes. The reporter's confirmation also bundled both changes, so the evidence clearly supports the path fix and is only suggestive on this one. Kept because it costs nothing if unnecessary. Full touchpad classification (gestures, two-finger scroll) remains follow-up work.

Quattro porting

Three things in #6093 would not have worked here:

  • sudo throughout — install/hardware/* runs as root (omarchy-setup-hardware hard-fails if EUID != 0).
  • the migration sourced the leaf — migrations run as the user, so it now escalates explicitly.
  • migration timestamp 1781432360 predates quattro's newest (1785095882) — renumbered.

Stale-file cleanup moved out of the install leaf into the migration; fresh installs never had that file.

Verification

  • Quirks syntax parses cleanly under real libinput with MatchUdevType removed.
  • Install leaf is idempotent — byte-identical file on rerun.
  • Migration end to end with stubbed sudo: removes the stale file, writes the drop-in, exits 0.
  • Migration on non-matching hardware exits 0 and writes nothing.
  • test/shell.d/migrate-scope-test.sh passes; bash -n clean.

Not verified on the hardware itself — @mijuny's B9406 is currently broken. The path fix is mechanically proven; a confirmation on a live B9406 before merge would be ideal.

🤖 Generated with Claude Code

The quirk masking the pad's bogus pressure axes never took effect, so the
touchpad stays dead on a fresh install: clicks register but the cursor
never moves.

libinput scans /usr/share/libinput for *.quirks and additionally reads the
single file /etc/libinput/local-overrides.quirks. It never scans /etc, so
the quirk written to /etc/libinput/asus-expertbook-b9406.quirks was
silently ignored.

Ship a drop-in under /usr/share/libinput instead. Appending to
local-overrides.quirks would work too, but that is the one file users edit
by hand, and a shared file can only be updated by grepping for a section we
already wrote -- which silently pins the first version we ever shipped. A
file we own outright is rewritten wholesale on every run.

Also drop MatchUdevType=touchpad: the pad's event node is tagged
ID_INPUT_MOUSE, so the constraint skips the section. Bus, vendor, product
and DMI already pin the device exactly.

Migration re-applies the quirk on existing B9406 installs and clears the
never-read file.

Co-Authored-By: Mikko Nyman <mikko@nyman.xyz>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 27, 2026 01:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dhh

dhh commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@mijuny — could you test this on a B9406 when you have one in hand? No rush if the ExpertBook is still out of action; I'd rather this sit than merge unverified.

The fix moves to a drop-in libinput actually reads, so the check is whether the cursor moves after a relogin:

# 1. Apply
sudo bash /usr/share/omarchy/install/hardware/asus/fix-asus-ptl-b9406-touchpad.sh

# 2. Confirm the drop-in landed and the stale file is gone
cat /usr/share/libinput/99-omarchy-asus-b9406-touchpad.quirks
ls /etc/libinput/

# 3. Relog, then confirm libinput applied it
libinput list-devices | grep -A5 -i touchpad

Two things beyond "cursor moves" that would be genuinely useful:

  • sudo libinput record on the touchpad node, so we can see what udev actually tags it. That settles the MatchUdevType question I flagged — the ID_INPUT_MOUSE vs ID_INPUT_TOUCHPAD story doesn't quite line up with the original jump-detection diagnosis, and I suspect the pad exposes more than one event node.
  • Whether two-finger scroll and tap-to-click work, or only pointer motion. If it's motion only, that confirms the device is being driven as a mouse and scopes the follow-up you mentioned.

If you'd rather test the migration path as an existing install would hit it:

rm -f ~/.local/state/omarchy/migrations/1785114924.sh
omarchy-migrate

@argrig666

Copy link
Copy Markdown

Tested this branch's installer on the actual ASUS ExpertBook B9406CAA (ASCP1D80:00 093A:4F05, I2C, /dev/input/event9). The fix works and the /usr/share/libinput location is the key change.

Validation performed:

  • Installed 99-omarchy-asus-b9406-touchpad.quirks using this PR's script.
  • libinput quirks validate --data-dir /usr/share/libinput passes.
  • libinput quirks list --data-dir /usr/share/libinput /dev/input/event9 prints AttrEventCode=-ABS_MT_PRESSURE;-ABS_PRESSURE;. Passing --data-dir here excludes my /etc/libinput/local-overrides.quirks, so this verifies the packaged drop-in itself matches.
  • libinput list-devices reports pointer + gesture capabilities, two-finger/edge scrolling, and button-area/clickfinger methods.
  • Masking the two bogus pressure axes restores cursor motion; the device advertises pressure max 2601 but reports near-zero values during valid contact.

One factual correction for the script comment: this device is not tagged ID_INPUT_MOUSE on this machine. udevadm info reports:

ID_INPUT=1
ID_INPUT_TOUCHPAD=1
ID_INPUT_TOUCHPAD_INTEGRATION=internal

So MatchUdevType=touchpad does match here. Removing it is still safe because bus/vendor/product/DMI pin the section exactly, but the old quirk failed because libinput does not scan arbitrary /etc/libinput/*.quirks, not because of the udev type.

There are still occasional light-contact dropouts after this libinput fix. A raw HID trace shows the controller itself clearing Tip Switch and pausing coordinates while Contact Count and Confidence remain set, so that residual sensitivity appears to be device firmware rather than something this quirk can address. This PR nevertheless fixes the original unusable/no-motion behavior and is ready from the B9406 hardware side.

@argrig666

Copy link
Copy Markdown

Post-reboot hardware follow-up: the residual light-contact interruptions and perceived sensitivity loss I noted above are now gone in normal use.

There were two simultaneous changes, so I cannot honestly assign causality:

  • the machine's BIOS changed from B9406CAA.304 on every prior recorded boot to B9406CAA.312 on this boot;
  • this is also the first full boot with the working libinput override plus a device-only Hyprland sensitivity setting of +0.35.

The PR's quirk is definitely active: libinput quirks list on the live 093A:4F05 touchpad reports AttrEventCode=-ABS_MT_PRESSURE;-ABS_PRESSURE;. This strengthens the end-to-end hardware validation for the PR, but it should not be read as proof that the quirk alone cures the previously observed residual dropouts. BIOS 312 is a plausible contributor to that part.

@bramvera

Copy link
Copy Markdown

Confirming this is still needed on a fresh Omarchy 4.0.4 install (ExpertBook B9406CAA, libinput 1.31.3, kernel 7.2.5-3-omarchy). The installer ran fix-asus-ptl-b9406-touchpad.sh and wrote /etc/libinput/asus-expertbook-b9406.quirks with the correct rule, but the cursor was dead until a copy of the same section was placed in /etc/libinput/local-overrides.quirks.

libinput quirks list --verbose /dev/input/eventN shows local-overrides.quirks being parsed and matching, and never opens the Omarchy-named file. The MatchUdevType=touchpad line does match on this unit, for what it is worth.

Would be great to see this land, since every B9406 owner hits it on first boot.

@mijuny

mijuny commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Second hardware confirmation of the PR drop-in (@mijuny, B9406CAA BIOS 304, libinput 1.31.3, kernel 7.2.5-3-omarchy, PR head 85abe52).

A/B with libinput debug-events on the touchpad node (ASCP1D80:00 093A:4F05 Touchpad), 20 s per run, finger circling:

  • PR drop-in only: 3992 POINTER_MOTION events.
  • No quirk (two runs): 0 POINTER_MOTION, only DEVICE_ADDED.

No jump warnings in any run, so on 1.31.3 a dead pad is silent rather than the original "Touch jump detected and discarded". I also ran sudo libinput record on the touchpad node during a no-quirk run, as you asked. The record header lists ID_INPUT_TOUCHPAD=1, ID_INPUT_TOUCHPAD_INTEGRATION=internal, DRIVER=hid-multitouch, and the raw stream carries full multitouch motion (ABS_MT_POSITION_X 1356-3651, ABS_MT_POSITION_Y 44-2436, 24 tracking IDs, BTN_TOUCH / BTN_TOOL_FINGER / BTN_TOOL_DOUBLETAP) with pressure only 0-152 against an advertised max of 2601. So the kernel data is fine and libinput is the layer dropping it. In every run libinput adds the node as a touchpad (cap:pg, tap, two-finger scroll, clickfinger), so it is not being driven as a mouse. Happy to attach the recording if useful.

libinput quirks list --verbose shows the drop-in full-matching on bus/vendor/product/DMI and applying AttrEventCode=-ABS_MT_PRESSURE;-ABS_PRESSURE;. An isolated fixture run confirmed the old /etc/libinput/asus-expertbook-b9406.quirks is never opened, and that the migration removes it, leaves an existing local-overrides.quirks byte-identical, and reruns cleanly (sudo shimmed).

On MatchUdevType, your multi-node suspicion is right: the pad exposes ... Mouse (ID_INPUT_MOUSE=1, relative axes only) and ... Touchpad (ID_INPUT_TOUCHPAD=1). MatchUdevType=touchpad matches the touchpad node here, as on argrig666's and bramvera's units. Without it the section also lands on the mouse node, where it is a no-op since that node has no absolute axes. Nothing broken, but I would restore the line (every Pixart entry in libinput's 30-vendor-pixart.quirks carries it) and fix the comment saying the pad is tagged ID_INPUT_MOUSE. That is a comment-and-scope change, not a substitute for the path fix.

Rebooted with the local override removed so only the drop-in applies: after a fresh login the pad works, and libinput applies the mask from /usr/share/libinput/99-omarchy-asus-b9406-touchpad.quirks alone. In the same session, pointer motion, two-finger scroll (262 SCROLL_FINGER events), physical click (BTN_LEFT), and tap-to-click all work.

For transparency: the hardware test was run together with my agents DeepSeek V4.1 Flash and Codex (gpt-6-astra). Astra also verified the installer and migration in isolation, and Claude Opus 5 and Grok 4.6 reviewed this draft.

@mijuny mijuny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two actionable edits from my test comment above, both comment/scope only; neither changes the file-location fix.

My A/B shows the pad exposes two nodes, ... Mouse (ID_INPUT_MOUSE) and ... Touchpad (ID_INPUT_TOUCHPAD). The quirk targets the touchpad node, which is correctly tagged, so the current comment premise is inaccurate; without the constraint the section also lands on the mouse node (a no-op there). Every Pixart entry in 30-vendor-pixart.quirks carries MatchUdevType=touchpad. Inline suggestions below.

Also, the PR body still says hardware verification is missing. My comment above is that verification (second B9406CAA, BIOS 304, libinput 1.31.3, kernel 7.2.5-3-omarchy), so it can be updated before merge.

Comment on lines +17 to +19
# The pad's event node is tagged ID_INPUT_MOUSE rather than ID_INPUT_TOUCHPAD,
# so a MatchUdevType=touchpad constraint would skip the section. Bus, vendor,
# product and DMI already pin the device exactly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# The pad's event node is tagged ID_INPUT_MOUSE rather than ID_INPUT_TOUCHPAD,
# so a MatchUdevType=touchpad constraint would skip the section. Bus, vendor,
# product and DMI already pin the device exactly.
# The device exposes separate mouse and touchpad event nodes. Match the
# touchpad node, which is tagged ID_INPUT_TOUCHPAD; bus, vendor, product
# and DMI restrict the quirk to this model.

mkdir -p /usr/share/libinput
cat > /usr/share/libinput/99-omarchy-asus-b9406-touchpad.quirks <<'EOF'
[ASUS ExpertBook B9406 Touchpad]
MatchBus=i2c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
MatchBus=i2c
MatchBus=i2c
MatchUdevType=touchpad

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
omarchybot and others added 2 commits September 28, 2026 01:36
The migration escalated on every matching machine, even after another user had already written the drop-in and removed the ignored file. A second user without sudo could not finish it, leaving it pending and blocking every later migration, which the migration guide rules out for machine-wide repairs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The installer writes the drop-in with `cat >`, so an interrupted write leaves an empty or truncated file. Existence alone then read as repaired, and the migration would be marked done with the mask missing. Checking for the mask line, which the heredoc writes last, catches both.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 860102b, with two fixes pushed to the migration. The quirk itself is unchanged since 85abe52, the head @argrig666, @bramvera and @mijuny confirmed on B9406 hardware.

What was run, on a disposable Omarchy worker with libinput 1.31.3: a malformed file at the old /etc/libinput/asus-expertbook-b9406.quirks leaves libinput quirks validate passing, while the same file at the new /usr/share/libinput/99-omarchy-asus-b9406-touchpad.quirks fails it, as does one in local-overrides.quirks. So libinput never reads the old path and does read the new one. With the hardware check stubbed to match, the migration moves a machine from the base leaf's output to the drop-in, reruns byte-identically, and writes nothing on other hardware. ./test/cli passes, as do migrate-scope-test.sh and the new asus-b9406-touchpad-migration-test.sh. The touchpad itself cannot be tested without the laptop, so the hardware evidence is the three reports above.

Pushed:

  • 793dac2: the migration ran sudo on every matching machine, even one another user had already repaired. A second user without sudo could not finish it, and it would block every later migration. agents/skills/migrations.md says a machine-wide repair should no-op in that case, so it now escalates only while the old file exists or the drop-in is missing.
  • 860102b: an interrupted cat > leaves an empty drop-in, and checking only that the file exists would count that as repaired. The migration now looks for the mask line, which is written last.

Both have a regression test, and each test fails when its fix is reverted.

Left for the maintainer: the script comment says the pad's event node is tagged ID_INPUT_MOUSE, and gives that as the reason MatchUdevType=touchpad was dropped. All three hardware reports contradict it. The pad has a separate Touchpad node tagged ID_INPUT_TOUCHPAD, and MatchUdevType=touchpad matches it. Without the line, the section also applies to the sibling Mouse node, where masking pressure does nothing. Restoring the line and deleting that comment paragraph would be the proportionate version, as @mijuny suggested. That changes which nodes the quirk matches, so it is left to you rather than pushed. The migration's timestamp also predates migrations shipped in 4.0.2 through 4.0.4. That is harmless, because the runner tracks each migration by filename.

Codex Medium gave the second opinion over three rounds. It found both migration defects above, and its last round, on 860102b, found nothing. It also judged the path change proportionate and flagged the MatchUdevType removal as a separate change the loading bug does not need, which matches the hardware reports. Its independence from this review is not guaranteed.

This now waits on the maintainer.

@argrig666

Copy link
Copy Markdown

Confirming the MatchUdevType note left for a maintainer, on this B9406CAA today.

The pad exposes two event nodes:

  • ASCP1D80:00 093A:4F05 Touchpad (/dev/input/event10) has ID_INPUT_TOUCHPAD=1 and ID_INPUT_TOUCHPAD_INTEGRATION=internal. It does not have ID_INPUT_MOUSE.
  • ASCP1D80:00 093A:4F05 Mouse (/dev/input/event9) has ID_INPUT_MOUSE=1.

MatchUdevType=touchpad matches the touchpad node. The script comment that the event node is tagged ID_INPUT_MOUSE describes the sibling mouse node. Restoring that match, and dropping the comment, matches what this machine exposes. The pressure-axis mask is unchanged; that is what makes the cursor move.

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.

6 participants