Skip to content

Make Apple Magic Trackpad pointer feel closer to macOS - #9276

Open
barmstrong wants to merge 1 commit into
omacom:quattrofrom
barmstrong:fix/apple-magic-trackpad
Open

Make Apple Magic Trackpad pointer feel closer to macOS#9276
barmstrong wants to merge 1 commit into
omacom:quattrofrom
barmstrong:fix/apple-magic-trackpad

Conversation

@barmstrong

Copy link
Copy Markdown

On Linux, a Magic Trackpad treats a light resting thumb as a second finger. That becomes two-finger scroll or a right-click, and small pointer moves feel jumpy compared with macOS.

Two layers cause it:

  • hid-magicmouse kernel two-finger scroll and 3-button emulation fire as soon as a second contact exists, before libinput can classify it as a thumb.
  • Stock libinput 50-system-apple.quirks sets AttrTouchSizeRange=20:10 on these pads, which turns size-based palm/thumb filtering off.

This change:

  • Installs /etc/libinput/omarchy-magic-trackpad.quirks so a light edge rest is ignored. Harmless on machines without the pad (match is by device name).
  • Writes /etc/modprobe.d/omarchy-magic-trackpad.conf (emulate_scroll_wheel=0, emulate_3button=0) when a Magic Trackpad is present, so libinput owns two-finger scroll and click. Two-finger right-click still works through clickfinger_behavior.
  • Skips those kernel options when an Apple Magic Mouse is also connected. That mouse still needs kernel surface-scroll emulation (same module).
  • Pins Hyprland adaptive accel and sensitivity 0 on the common Magic Trackpad device names, so raising the global pointer speed does not make this large pad jumpy.
  • Migrates existing installs and applies the kernel params live via sysfs when the module is loaded, so a reboot is not required for that half.

Tested on a USB Magic Trackpad 2 (05AC:0265) on Omarchy 4.0.1. Resting-thumb scroll/right-click stopped, and fine text selection became usable.

test/shell.d/magic-trackpad-test.sh covers install and migration for trackpad-only, mouse-present, no-device, and Bluetooth USB-C IDs.

hid-magicmouse treats a resting thumb as a second finger, so a light
edge contact becomes two-finger scroll or a right-click. Stock libinput
also disables size-based palm/thumb filtering on these pads
(TouchSizeRange 20:10). Skip kernel gesture emulation when a Magic
Trackpad is present, re-enable libinput thumb/palm thresholds, and keep
Hyprland's default sensitivity and adaptive accel on the pad even if
the user raises the global pointer speed.

The same kernel module drives Magic Mouse, whose surface-scroll still
needs emulate_scroll_wheel, so those options are skipped when a Magic
Mouse is connected.
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.

1 participant