Enable palm rejection on MacBook Pro Late 2013

Hi!

Running nixos 26-05, Cinnamon v: 6.6.8, on a MacBookPro11,1.

I wanted to enable touchpad palm rejection, “Disable touchpad While Typing” cause the mouse pointer keeps jumping everywhere when I type. The setting is enabled in cinnamon settings, but has no effect.

Cinnamon is not the culprit, the setting is correctly enabled:

$ gsettings get org.cinnamon.desktop.peripherals.touchpad disable-while-typing
true

Was expecting xinput / libinput to show the current value of the option “Disable While Typing Enabled”

sudo xinput list-props $myTouchpadDevice

Device ‘bcm5974’:

… plenty of libinput options but no mention of the option I was expecting

When asking libinput about the device

Disable-w-typing: n/a

I searched deeper, how udev actually setup the touchpad:

$ sudo udevadm info /dev/input/event8

ID_INPUT_TOUCHPAD_INTEGRATION=external

My guess was: the touchpad is incorrectly seen as external, hence no Disable While Typing capability in libinput.

To confirm, I booted Fedora and the udevadm output was:

ID_INPUT_TOUCHPAD_INTEGRATION=internal

Then I added an extra udev rule in my configuration.nix to force my touchpad to be seen as internal:

services.udev.extraRules = ‘’

ACTION=="add|change", \\

SUBSYSTEM=="input", \\

ENV{ID_INPUT_TOUCHPAD}=="1", \\

ENV{ID_VENDOR_ID}=="05ac", \\

ENV{ID_MODEL_ID}=="025a", \\

ENV{ID_INPUT_TOUCHPAD_INTEGRATION}="internal"

‘’;

The patch works, the palm rejection works, and the outputs are:

ID_INPUT_TOUCHPAD_INTEGRATION=internal

libinput Disable While Typing Enabled (323): 1

libinput Disable While Typing Enabled Default (324): 1

Disable-w-typing: enabled

Maybe it’s a bug in my configuration, but I suspect there is something missing or a regression in udev rules. I wanted to share my findings. I’m willing to fill a bug report and help fixing it.

Thanks for reading

Since it works in Fedora, the bug is in Cinnamon, no, or am I missing something?

Anyway, this should work as a workaround:

services.libinput = {
enable = true;
touchpad.disableWhileTyping = true;
};

Thank you for your suggestion.

I replaced my extra rule with libinput configuration and I checked with nix repl that the option was applied: false without libinput configuration, true with it.

But unfortunately, it does not work, the mouse pointer can still be moved and clicked when typing.

And still:

> sudo libinput list-devices
Device:                  bcm5974
Disable-w-typing: n/a

My understanding is:

  • hardware is recognized ok
  • driver bcm5974 picked ok
  • udev rules mark it as «external» (ID_INPUT_TOUCHPAD_INTEGRATION=external), ko
  • keyboard is marked as internal, ok
  • libinput option is enabled, but the feature can only be activated when both the keyboard and touchpad are internal.

With the extra rule:

> sudo libinput debug-events
-event0   DEVICE_ADDED                 Apple Inc. Apple Internal Keyboard / Trackpad seat0 default group6  cap:k
-event1   DEVICE_ADDED                 bcm5974                           seat0 default group6  cap:pg  size 107x75mm tap (dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on dwtp-on

dwt is on.

Without the extra rule:

-event0   DEVICE_ADDED                 Apple Inc. Apple Internal Keyboard / Trackpad seat0 default group6  cap:k
-event5   DEVICE_ADDED                 bcm5974                           seat0 default group6  cap:pg  size 107x75mm tap (dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger

No mention of dwt.

When trying with Fedora (Bluefin), the actual DE was Gnome, but I don’t think it’s relevant here. The default udev rules from Fedora mark the touchpad as internal. Then i believe that’s what makes it eligible for DWT in libinput.

To go ahead, i think i need to dive into udev debugging. At least to see where the behaviour differs from Fedora. I’ll let you know if I come with sth.

Edit, note to self:

In Nixos, lib/udev/rules.d/65-integration.rules:

DRIVERS==“usb”, ATTRS{devpath}!=“0”, ATTRS{removable}==“removable|unknown”, ENV{ID_INTEGRATION}=“external”, GOTO=“libinput_integration_compat”

⇨ when bus==usb and attached==unknown, integration=external

In Fedora, /usr/lib/udev/hwdb.d/70-touchpad.hwdb
touchpad:i8042:*
touchpad:rmi:*
touchpad:usb:*
ID_INPUT_TOUCHPAD_INTEGRATION=internal

touchpad:bluetooth:*
ID_INPUT_TOUCHPAD_INTEGRATION=external
⇨ when touchpad usb, integration = internal

1 Like