Friday, December 4, 2026

libinput and new limits for multifinger tap-and-drag

We all know the issue, you're at your desk, tapping away and suddenly! Oh No! That movement you tried to do was actually a drag! If that ever happened to you, you're definitely not entitled to compensation. But read on, because there's a light at the end of whatever dark thing you're currently imagining yourself in.

Since 1.17 (2021) libinput has had support for multifinger tap-and-drag. Tap-and-drag is of course the feature that lets you go "finger down, finger up, finger down, hold it there" while the logical button event goes "down" and ... nothing else. In short, it's how you can do dragging on a touchpad without having to use physical buttons. Multifinger tap-and-drag, implemented by satrmb (here you can nod appreciatively), provides us with the multifinger version of this - a two-finger tap followed by a single finger down allows the equivalent of right-click dragging[1].

Now, and this may come as a surprise to you - some people have a need for being able to right click but no real need for right-click dragging. Or at least via tapping (after all nearly all touchpads still have physical buttons). What those people[2] have a need for though is a right click followed by normal pointer movement immediately after. And it turns out that multifinger tap-and-drag gets in the way of that - by design.

So what do we do? We fix it, just like Bob would! libinput 1.33 includes a new configuration option to restrict which finger combination supports multifinger tapping. With many thanks to OleksandrChornyi2010 for implementing this feature, we can now tell libinput one of, currently, LIBINPUT_CONFIG_MULTI_FINGER_DRAG_SINGLE_FINGER_ONLY, LIBINPUT_CONFIG_MULTI_FINGER_DRAG_SINGLE_AND_TWO_FINGER or LIBINPUT_CONFIG_MULTI_FINGER_DRAG_SINGLE_TWO_THREE_FINGER. I'm not telling you what each of these options does, that's your homework for this week.

As usual, the options will need to filter through the various compositor settings to take effect.

[1] pending your configuration, yada yada
[2] probably not a pure circle of a venn diagram

No comments: