Linux Touchpad Project revenue as of June 2020. Please consider supporting us here.

Welcome to the third of four scheduled Summer updates on the Linux Touchpad Project (LTP). We've got a lot of exciting progress to share from the past month, so I'm skipping the usual recap. If you're new, here's the rundown of what this project is about, and here's the previous update.


Huge thanks to the 108 sponsors who have contributed the resources needed to positively transform the state of the Linux touchpad experience. As the stats above illustrate, Github currently estimates that the project's income at $1,420 per month. This project can transform that coin into 28.4 hours of developer time per month, which can go a long way if you have the right developer.


And thus, it is with great pleasure that I'd like to introduce Povilas Kanapickas, the developer that I've chosen to steward this project. I received about five qualified applicants to lead the LTP; Povilas stood out from the pack in several ways, but foremost was communication skills. In our first month working together, he has proven to be the optimal blend of strategic, pragmatic, optimistic, and realistic.


Bottom line: I'm optimistic about the ROI we will see with Povilas at the helm. Initially we're targeting 30 hours/month, but that can increase if more folks see fit to contribute.


linkHow to help

Take our latest 5-minute developer mini-poll, assessing on touchpad distros and WFH impact


linkDeducing the highest impact opportunity

Once Povilas and I worked out the paperwork to get started, he dove in straightaway to help realize the goals of our past survey respondents. To refresh your memory, here were the top-voted improvements among 1,600 respondents to the previously posted Linux touchpad poll:


By a substantial margin, the top voted improvement was multitouch (other top-5 voted improvements)

Multitouch stands apart as the feature that users have been most eager to see incorporated into the Linux touchpad experience. What makes the "support multitouch" an especially interesting prospect is that, in many ways, it's already done. As Peter Hutterer and a few commenters pointed out, libinput has ostensibly supported multitouch for a few years. The reason that support has not translated into the multitouch gestures that people want is that there are many pieces that must work together in concert for multitouch to happen. The coordination between the input driver, the input protocol, the OS, and the apps themselves must be precisely understood and navigated.


So, that's what Povilas has been doing. Working closely with Peter Hutterer, he has deconstructed the pieces that need to coalesce to result in a Linux multitouch experience that Just Works. Let's dig into the technical details of how we can pull this off.


linkLinux Touchpad Development Progress Report

This section provides the project's technical updates, courtesy of Povilas.


linkMultitouch on touchpads

It's important to know how multitouch works on Linux at a high level to understand what we're doing and why. From a technical perspective, multitouch support consists of four parts which all need to work together.


The first part is the low-level input driver. This translates touchpad input to mouse movements or multitouch gestures. Libinput and the Linux kernel already handle this part -- so they don't need to be enhanced.


The second part is the display server. It collects input events and distributes them to applications. Nowadays the end user is most likely to be using either the old Xorg display server or one of the newer ones that support the Wayland protocol. The Wayland display servers already support touchpad gestures, whereas Xorg does not.


The third part is various GUI toolkit libraries. These include Gtk, Qt, WxWidgets and so on. They do the heavy lifting of handling the input events that come from the display server. Most toolkit libraries have a way to represent gestures in a generic way, but it seems that only Gtk has full support for Wayland touchpad gestures at this point.


The fourth part is the applications themselves. If they use a GUI toolkit, then touch gesture support is effectively having code that says: "if the user does three-finger swipe, then do X".


An astute reader can notice that there is already a happy path for touchpad gestures. If a user has a display server that speaks Wayland protocol and uses a Gtk application that implements gestures, then the gestures will already work. Unfortunately, the majority of users are still on distros that use the Xorg display server, and many applications use non-Gtk GUI toolkits. In order to make multitouch on touchpad work well, we need to fix as many unhappy paths as possible with our development resources.


In spite of newer alternatives, Xorg display server has maintained heavy usage across modern Linux distros. By all appearances, it's positioned to remain an "unhappy path" for many users, for years to come. The Wayland protocol is very promising, but the display servers implementing it still have various serious issues five years after 1.0 release of Wayland. Also, certain popular applications will need significant upgrades in order to work on Wayland. Thus, if we want multitouch that Just Works, it makes sense to retrofit Xorg even though the Wayland protocol is the future.


linkHatching a multitouch plan

In light of our research into the four aspects of multitouch support, here's our plan to integrate multitouch that Just Works for as many users as possible:


Add gesture support to the Xorg display server

Improve the toolkit libraries to support the new functionality implemented in the first step

Add touchpad gesture support to applications where missing


The first step is already in development. A proposal for a protocol revision of the X Input Extension protocol has been submitted to Peter Hutterer, who maintains this part of the Xorg display server. He thinks that our plan has a chance of success, but a lot of work need to be put into this. Realistically, we will need to implement touchpad gesture support on at least 2 widget libraries before the new X protocol can be deemed stable.


This is a challenging project as it touches multiple core parts of Linux systems. They move slowly due to the risk involved. A "fun" fact: if all of this work was already done today, it would appear on Ubuntu as of next April's release.


Additionally, there will be scheduling dependencies between releases of the new Xorg and the widget toolkits. Fortunately, we will be able to provide testing packages much earlier, so interested users can try new functionality as soon as it's implemented!


linkNext steps

Our short-term plan is to finalize the main parts of the new specification of the X Input Extension in the following weeks. Then we can start implementing proof-of-concept support in the XOrg display server and the widget libraries. This will be a good learning opportunity to figure out errors in the specification -- we estimate this should be finished sometime in July. After that, we'll apply the learned lessons to the specification and then start implementing the gesture support in a proper way. At the moment it's hard to say how long this part will take as there are many unknowns. Having said that, initial testing packages should start appearing sometime in August or September.


linkWrap up

Nobody said it was going to be easy to get Linux touchpads working as well as macOS touchpads. The coordination required to weave multitouch through the various layers of the Linux stack isn't for the faint of heart. But as is hopefully apparent from this update, real progress is now being made on this thanks to the efforts of the Linux community. 🐧


If you'd like to continue seeing improvements to Linux touchpads, the best way to help support our project is by contributing to it on Github. Now that we have Povilas on board, we have a very direct path by which to translate interest -> revenue -> action. The pipeline is primed for your contribution to make a tangible difference in how smoothly Linux touchpads work for years to come.


The #2 way to help is by participating in our latest 5-minute developer survey, which covers more details about the distros being used for Linux touchpads. This can help us keep our focus on the distros and touchpad improvements that matter most to you.


Thanks again for your support!