Skip to content

Load Asahi MTP quirks while preserving administrator overrides - #463

Open
z23 wants to merge 5 commits into
omacom:quattrofrom
z23:fix/100-mtp-palm-rejection
Open

z23 wants to merge 5 commits into
omacom:quattrofrom
z23:fix/100-mtp-palm-rejection

Conversation

@z23

@z23 z23 commented Sep 18, 2026 •

Copy link
Copy Markdown

Related to #100.

Ensure the Asahi MTP keyboard and touchpad quirks are loaded by libinput. Local overrides must use /etc/libinput/local-overrides.quirks; the previous leaf wrote omarchy-apple-mtp.quirks, which the standard loader does not read. See libinput’s local device-quirk documentation.

The hardware leaf and existing-install migration now use the supported file. A marked Omarchy block with distinct section names is placed before preserved administrator content. Re-running replaces only that block; administrator settings remain after it and retain libinput’s last-matching-value precedence. Existing permissions and symlink destinations are preserved, unchanged content is not rewritten, and ambiguous markers fail before mutation. Arbitrary legacy-named files are left alone.

The managed block applies the existing Apple MTP touchpad and keyboard-internal quirks without requiring MatchVendor, which Asahi platform devices may lack. It obtains the measured fallback dimensions from the event node’s ID_INPUT_WIDTH_MM and ID_INPUT_HEIGHT_MM. Zero or invalid dimensions are omitted so they cannot invalidate the quirks database. It does not retune palm-size or touch-size thresholds.

The original size-based explanation was too broad. On the previously inspected 16-inch M2 Max, the kernel already reports the axis resolution, so changing the 104×75 size hint to 157×96 does not change size math or establish a palm-rejection fix. The hint is a fallback for devices without kernel resolution. disable_while_typing = true also restates an existing Hyprland default. The configuration comment now states the size-hint limitation explicitly. #100 remains open pending confirmation that the applicable quirks resolve its reported behavior.

Validation: runtime fix tested at 30eb205b; final head 169f2530 adds only the matching configuration-comment correction, with runtime settings unchanged.

  • MTP regression tests: 13 checks passed with the actual libinput 1.32.0 quirks parser, including administrator overrides, idempotence, symlink/mode preservation, ambiguous-marker rejection, and measured/unknown/zero dimensions. The supported-path regression fails against the previous implementation.
  • Install wiring, missing-sysfs leaf guards, command metadata, and syntax checks passed.
  • Mac ./tests/all: 13 suites passed; privileged btrfs/LUKS rehearsal skipped.
  • Local standard ./test/all: CLI passed; exactly the same 7 shell-test files and failure signatures as the original PR head failed among 295 files. These depend on the missing sibling omarchy-pkgs checkout, missing PyYAML, host ACPI lid detection, and inherited NO_COLOR. No new failures.

GitHub CI at final head 169f2530 passed Syntax + shellcheck, test/all, and tests/all: completed test run. The separate ARM installer run is still in progress.

No host /etc/libinput files were changed, no packages were installed, and no physical palm-rejection acceptance test was performed.

…ware

libinput's shipped Apple MTP quirk uses AttrSizeHint=104x75 (a 13-inch
pad). 14" and 16" Apple Silicon trackpads report their real size via
udev; this 16-inch M2 Max is 157x96 mm. The undersized hint makes palm
detection map onto the wrong physical area, so resting palms while
typing move the cursor and click (omacom#100).

Write /etc/libinput/omarchy-apple-mtp.quirks with the measured size,
mark the MTP keyboard internal without MatchVendor (Asahi platform
devices often have no ID_VENDOR), and keep disable_while_typing on in
the Hyprland defaults. Existing installs get the same leaf from a
migration.

Fixes omacom#100
@z23
z23 requested review from dhh and ryanrhughes as code owners September 18, 2026 04:33
@z23

z23 commented Sep 18, 2026

Copy link
Copy Markdown
Author

Follow-up after checking this on a 16-inch M2 Max (apple,j416c, Apple MTP multi-touch).

AttrSizeHint is not expected to change palm rejection on this class of pad. The kernel already reports the real size:

  • udev: ID_INPUT_WIDTH_MM=157, ID_INPUT_HEIGHT_MM=96
  • ABS_MT_POSITION_{X,Y} resolution 98 units/mm → ~157.5 × 96.4 mm

libinput only applies AttrSizeHint when abs resolution is missing (evdev_fix_abs_resolution returns immediately if the kernel set it). The shipped 13-inch 104x75 hint is therefore already ignored here, and replacing it with 157x96 is a no-op for size math. Same for spelling out disable_while_typing = true: Hyprland already defaults it on, and this machine already has tap_to_click = false.

What this PR still does on Asahi MTP:

  • restates ModelAppleTouchpad / palm-size / keyboard-internal without MatchVendor, which matters if a platform device has no ID_VENDOR
  • records the measured hint so a pad that doesn't report resolution gets the right fallback instead of 104×75

It does not retune AttrPalmSizeThreshold / AttrTouchSizeRange, so if palms still move the cursor while typing on a 16-inch Asahi pad, that path is still open. I have not written /etc/libinput on this box from the PR.

@malik-na malik-na added the lvl 0 Core userspace: display, audio, video, graphics, memory, storage, battery, keyboard, network, BT. label Sep 18, 2026
@malik-na malik-na added the US label Sep 20, 2026
@z23 z23 changed the title fix(hw): measure the Asahi MTP pad so palm rejection matches the hardware Load Asahi MTP quirks while preserving administrator overrides Oct 5, 2026
@z23

z23 commented Oct 5, 2026 •

Copy link
Copy Markdown
Author

I have corrected the title and description to match the earlier size-hint findings, and removed Fixes #100. On the inspected 16-inch M2 Max, the kernel already supplies axis resolution; the measured hint is a fallback and does not establish a palm-rejection fix.

Checking how the override is loaded also exposed a concrete installer problem: libinput reads /etc/libinput/local-overrides.quirks, whereas this leaf wrote an unsupported filename. Commit 30eb205b uses the supported file and replaces only a marked Omarchy block. Existing administrator content stays after that block so its values retain precedence; ownership, mode and symlinks are preserved. Zero/invalid dimensions are omitted rather than producing an invalid quirks entry. The matching configuration-comment correction is in 169f2530, with runtime settings unchanged.

The 13 focused checks pass with the real libinput 1.32.0 parser, and the Mac-specific suite, install wiring, metadata and syntax checks pass. Independent QA reproduced exactly the same seven broader-suite environment failures as the original head, with no new failures. The new file-path regression fails on the previous implementation. No host configuration was changed and no physical palm-rejection test was performed, so #100 stays open for hardware confirmation.

GitHub CI at 169f2530 has now also passed the full test/all suite, Mac tests/all, and syntax/shellcheck (run). The separate ARM fresh-and-repeat installer job is still running.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lvl 0 Core userspace: display, audio, video, graphics, memory, storage, battery, keyboard, network, BT. US

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants