314 points · by wbharding · 6y ago · 324 comments
- Take the Linux Touchpad Experience Poll: https://www.gitclear.com/polls/linux_touchpad_experience
- Become a sponsor on GitHub: https://github.com/gitclear/libinput (GitHub matches every donation up to $5k, so your $5 can become $10)
- Get paid $50/hr to work on libinput: http://archive.is/FGHTT (link to archive of the original article ty danso)
Luckily, this should be relatively simple. Anyone who wants to make this should be looking at the Chromium touchpad code (runs linux, and my Pixelbook touchpad is as good as a macbook touchpad. For example, the touch input filter: https://chromium.googlesource.com/chromiumos/platform/touch_... )
I think you'd get most of the quality with a kalman filter (A really cool filter that takes unstable input, and corrects it based on probabilities to give very high quality output).
[1] http://douglas.mayle.org/files/synaptics-two-finger-click.di...
(I have not used my touchpad since getting used to a trackpoint, but I vaguely remember using the synaptics driver to get it usable)
Edit: NVM, I read another one of his blog posts where he addresses synaptics and mtrack.
Or go straight here: https://github.com/sponsors/gitclear
I think $50/hr might not be enough. I imagine there are very few devs who could do this correctly, doubling the wage and halving the time would cost the same but probably yield better results. I'm not the one paying tho.
The big problem I encountered was poor palm detection: I learned through this process that I have a tendency to use the touchpad with my right hand, while my left hand is still in typing position. This means that the edge of my left palm rests along the upper-left corner of the touchpad. This would result in the driver sometimes detecting two touchpoints instead of one, and I would end up scrolling when I meant to move the pointer.
The result of this was pretty amazing to me: after a few hours of use I found that my wrists, shoulders, and neck hurt because I was subconsciously trying to adjust my hands to avoid this. After a couple of days trying different drivers and tweaking config files, I ended up conceding that it just wasn't there yet.
It's too bad: I have lots of imposter syndrome about understanding my OS and using Linux seems like a great cure. But after literally decades of trying, what I've noticed is that hardware (or at least, my acclimating to new hardware) always advances enough past Linux's capabilities that the switch is difficult. In the past, it was about getting sound cards or WiFi working, and nowadays it's about things like touchpads and high-resolution displays.
Also, understand that there's libinput or touchpad synaptics and you can use the other one if one isn't working for you. I have had better luck with libinput myself but it probably depends on the hardware.
Thankfully we've moved past those problems for now, until you want to use multiple screens or use a touchpad.
Desktop Linux still has a long way to go if there is ever going to be any appreciable market share.
If you figure out the right settings while using the legacy synaptics driver, please consider translating them a libinput quirks file and sending them back to the right place. I promise you are not the only one who doesn't want to fiddle around with legacy drivers anymore.
There's always some annoying little problems that take a mountain of effort to properly diagnose and solve. Things like dual monitor support not working properly when the monitors have different resolutions, or YouTube dropping out of fullscreen when you focus on a different window.
To be fair, these kinds of issues are probably no problem for someone with lots of experience... But I'm not one of those.
I also find that the gap between windows and Linux has narrowed dramatically over the last 10 years. Whenever I try a fresh install (every couple years), I'm surprised at how much better it feels.
If the issue is hardware, then we'd blame OEMs.
If it's software, then we'd blame, say, Microsoft.
If it was a combination of these two, then we could say that Apple is the only one that controls both... if it wasn't for the Surface series which still has atrocious touchpad experience.
In one corner, Apple got there by mainlining trackpad and trackpad software development...with iPhone touchscreen R&D. You have basically the largest R&D product in the world dictating the software that controls their trackpads. We are talking advanced finger speed and direction prediction (not just detection), AI to ignore unintended touches, and hardware and software that have been built specifically for them. It's no secret that all of Apple's laptops effectively have the same trackpad in various sizes and that the tech in the touchpad is nearly identical to to that in an iPhone minus a display. (Including the taptic engine and `3D Touch` aka, `Force Touch`.)
In the other corner, you have people with laptops by random companies with random hardware and drivers written by FOSS contributors/ Laptop ODMs/ Legacy Microsoft Drivers.
FOSS is fantastic, but it can't generally compete with a Billion dollar a year R&D budget stretched over 10 years feeding back improvements.
The 2005 Powerbook was the first to support multi-finger input on the trackpad... probably not a coincidence. We now know that the tablet/phone project kicked into high gear around this time as well.
I think this is really where Apple took a big step in their trackpads across the board. I had an iBook from before this time and while the trackpad was nice, I did not think it was way better than my PC laptop's trackpad. The biggest difference was that the Mac trackpad was about 30% larger.
Apple also invested in touch concept company-wide, including gestures in their marketing and shipping a trackpad as a first-class option for desktops in 2010. I think part of the reason Apple has done well with touch is that they just prioritized it and tried harder at it.
As the above commenter mentioned: a combination of hardware & software gives Apple and inherent advantage, which—along with Apple just having a culture of prioritising UX in their products (and MS kind of being in decline at the time, before their recent resurgence)—would explain the pre-iPhone trackpads being ahead of their competitors.
With Surface, while MS do control both elements, they're playing catchup on years and years of progress by Apple.
Combine all that with the recent mainlining of iPhone R&D and catching them seems really really tough.
Scrolling, zoom, clicking, what else do I need? :/
For some makers that’s going to be performance or cost. For businesses laptops reliability and security are going to be big factors.
For Apple the overall experience is a large part of why people buy; Apple users want a great hardware experience integrated into the OS, and they’re willing to sacrifice performance and price to get it.
It’s not some purposeful design decision. They just don’t have the same caliber of engineers or management that Apple has.
Even these “nice” PC laptops still come with a PSU that has ugly plastic-coated white wraparound paper stickers and labels on the black cords with meaningless unimportant shit on them (leaving oily adhesive residue on the cord even if you cut it off), bricks in the middle of the cable (AC and DC lines out opposing ends), plastic twist ties, in plastic baggies covered in meaningless production stickers. Apple doesn’t even do that on the cheap AppleTV.
This is to say nothing of the ugly metallic stickers they slap on the wristrests to spam you for the life of the machine.
The janky plastic trackpads are one of many issues with the approach that most of the industry takes. There are very few machines that even remotely aspire the level of care Apple puts into their each and every product.
Apple also just overhauled the speaker system in the 16” rMBP, making it easily 50% better than any laptop I’ve ever heard. It’s startlingly good, sound I never thought I’d hear out of a laptop.
I’m at a place in life where I have broken my iMessage dependency and find KDE to be delightful; I would absolutely love to pay a premium for an equivalent quality PC laptop, but there aren’t any in the ballpark, even. There are ones that are merely “good” (Razer Blade), none “great” (though the Pixelbook Eve comes close!), and zero have ever been insanely so, AFAIK.
Happy to be corrected if I’m wrong!
And most of them have shitty touchpads. Apple excepted, of course.
Imagine thinking this was a bad thing.
PC laptop manufacturers? With a few exceptions their keyboards are just garbage.
Secondly, non-Apple laptops aren't cheap-feeling plastic junk. This is the classic "Let me compare my iPhone 11 Pro to this Alcatel 1" - well the iPhone 11 Pro is 25x the price. The Dell XPS 13 isn't cheap-feeling plastic junk, nor is the Thinkpad X1 carbon, nor is the Microsoft Surface Laptop. They're all premium products.
It is also very hard to support obscure hardware that only has obfuscated closed-source drivers, or has no Linux drivers at all. This requires lots of trial-and-error and workarounds (in addition to the normal level of hardware-specific tweaks that have to go into something like libinput) and takes up a disproportionate amount of testing time. Some input devices fall in this category, such as those built into newer apple laptops.
Linux slavishly adheres to the published Microsoft HID guidelines. Since neither Microsoft nor any of the hardware vendors do, it causes problems.
The Microsoft HID guidelines dictate how packets of information are reported to userspace. That is information like touch id, touch size, velocity, and direction. The userspace then has to integrate the various data into touch and gesture recognition. A thousand different software developers do that a thousand different ways, mostly badly.
The end result in the Windows and Linux world is a thousand different developers produce touch and gesture recognition software a thousand different ways of hundreds of different devices that work in completely different ways. A sort of orchestrated chaos like an ant colony.
Apple dictated to its hardware vendors exactly how to write drivers that work with its software, and it has centralized software embedded in the OS to handle touch. A dozen expert developers do touch and gesture recognition for all apps using strictly controlled drivers from a select few vendors, all centrally controlled like a massive flock of starlings swooping and gliding and conducted by the ghost of Steve Jobs standing on the ground.
I fear that Linux touchpad support is a victim of Conway’s law [1] which means this problem can’t be solved by one specific team. It may mean rewriting the whole stack (and rewriting applications as a result).
the tl;dr is that when touchpads were added to windows, they used the legacy APIs which made assumptions about them being mouses with notched scroll wheels. And while microsoft has since released APIs which support high precision scrolling, applications have been slow to adopt them (sometimes because of wanting to be compatible with windows 7 and older).
Although at this point I'd argue Microsoft should be forcing a minimum level of experience on all Windows devices and providing the software tools and hardware guidance needed to get there.
https://www.howtogeek.com/286905/what-is-a-precision-touchpa...
I also wonder what the experience is like using Linux on a Mac trackpad. Is it closer to the experience on MacOS or closer to the experience with Linux on commodity hardware? If the latter, maybe it makes sense to improve that first.
Maybe not though, if the synergy between hardware and software is the "secret sauce" that's missing then maybe optimizing the mac trackpad for Linux would be wasted effort.
If you don't like the scrolling in UWP it probably has more to do with it's acceleration graph than its capability. That, and macOS seem to just make their UI animations way smoother than anything I've seen on Windows and Linux. The Windows desktop switching and "expose" animation kills me every time it janks.
I don't know what's stopping Microsoft from porting this scrolling behavior to Win32, and to be fair it seem like they tried (scrolling in Explorer is noticeably different on a precision touchpad even though not as smooth) but probably they're held back by backward compatibility or that it's too much of an effort to make that pig fly.
I have run Linux on my old MBP 2015 though, and the trackpad is usable but as soon as you boot macOS again you realise how crap it was on Linux. Tweaking accels/speeds can bridge the gap a little but it's still not nearly as good.
I have used Linux (fedora-xfce) inside VMWare Fusion on Mac laptops on a daily basis for at least the last decade, and also have run Linux on Thinkpad and System76 hardware from time to time.
In general I find the trackpad experience of Linux-inside-VMWare-on-Mac to be basically identical to that directly on Mac, and much (much) better than either Linux on Thinkpad or on System 76.
There is some oddness in the VMWare setup- in the VMWare parent process, over time, RAM usage grows, and a slight lag is introduced into the UI experience inside Linux (both trackpad and keyboard).
When this gets too noticeable, I kill the VMWare parent (which does not kill the actual VMs), then restart it. The lag is eliminated, the memory leak is cleaned up, and the child VMs are not impacted.
I imagine the abstracted event flow to be:
HW -> Mac driver -> VMWare user space UI loop -> Linux generic driver -> Linux userspace
while the Linux only event flow would be
HW -> Linux driver -> Linux userspace
While there is some jankiness in VMWare's delivery of events to the generic Linux driver that the kernel uses for the VMWare "hardware", the work happening in the Mac driver is the magic that delivers great experience.
As for mouse movement, like you're saying it's pretty good in a VM when it's HW -> macOS -> sending X and Y values to the VM and guest OS.
Windows on hardware, even using Apple's drivers, is a bit "off." I lose drags, moving around is odd, and I feel like I have to be more deliberate with clicking. I never seem to have those issues when using Windows inside a VM.
This might be https://gitlab.freedesktop.org/libinput/libinput/-/issues/34... or https://gitlab.freedesktop.org/libinput/libinput/-/issues/28.... The latter is easy to fix by commenting out hysteresis activation if you know your hardware doesn't need hysteresis. A proper fix would be to improve the wobble detection but neither me nor Peter apparently have time to work on that. :-/
Very annoying "feature" and the worst part is that it can not be disabled nor there are any plans on putting it behind a toggle flag, see https://gitlab.freedesktop.org/libinput/libinput/-/issues/19...
Luckily it can easily be patched on your own.
I miss some of the multi-touch features (three-finger-swipe-up) but it's pretty much identical excepting those. When I close the lid and plug in to a monitor, you can't tell much of a difference.
I ran Lubuntu on a 2012 macbook pro for a couple years and it was much closer to an "Apple" experience compared to my current setup of Pop_OS on a P52S Thinkpad.
Admittedly I have Linux set up for keyboard use with a TWM, but the trackpads, when I used them, have been fine.
In addition to multi finger gestures, the biggest gaps for me are general handling of inertia, scrolling smoothness, ignoring accidental touches, fine grained pointer accuracy, and handling of alt-clicks(two finger right click, three finger middle-click, etc).
Again, it works, and is usable, but it feels like it was finished before the bar was raised on the trackpad User Experience.
I didn't know there was a "trackpad meme" - but to me the thinkpad is fine, but unquestionably more frustrating than the mac. I've tried to tweak things but never made it feel good.
I even set up a camera at one point to try and figure out what was causing my frustrations. Looking at the footage I noticed even though the thinkpad felt slower (or a bit "sluggish"?) I would still often slightly over-shoot my target.
I can't figure out exactly why it's different but it sure feels like some sort of black magic on the macs part.
The other issue is that PC laptops tend to have much smaller trackpads for whatever reason, allowing for less room for fine adjustments after swiping.
My old Asus UX305 feels as good as a Mac, the trackpad is large, the scrolling has momentum and feels good, etc.
On the other hand, my HP Envy trackpad is terrible, the palm detection doesn’t work well, the trackpad itself is too small to aim properly, the acceleration is pretty high and hard to aim. It almost seems like the team responsible for the design of the laptop never considered what it would be like to use such a small trackpad.
1. Linux touchpad scores on par with Macbook touchpad per mouseaccuracy.com testing. As of today, I can consistently score twice as high on macOS (average score 250 with “Hard” + “Small” options) vs Linux (average score ~100).
2. Visual or terminal-based means to configure rudimentary touchpad settings. The fewest options I could imagine supporting for v1 would be: scroll speed/acceleration, scroll speed, natural scrolling toggle, hopefully support for gestures.
3. First-class palm and thumb detection/ignoring
Numbers 2 and 3 are already in libinput. I am still struggling to understand what it is the author feels they need to fork the project for; there is some additional software that needs to be provided to really get the mac-like desktop experience with gestures, but that is covered by the libinput-gestures project. https://github.com/bulletmark/libinput-gestures
It looks like this doesn't take viewport size into account. A smaller window still shows dots of the same size, just distributed over a smaller area. Given that it's (more) idiomatic to maximize windows under Linux and Windows than under MacOS, those results could be skewed.
_Is_ it? I know that it seems to be kind of a thing on Windows, but I've never really noticed it with Linux.
I've used various different laptops (Macbooks, Windows machines, Linux-based ones, Chromebooks), and while the experience was certainly different, Macbooks never felt particularly superior. They seem to be configured (by default) to move cursors fairly slowly compared to the competition, but it's a lot about just getting used to it. There are of course some cheap, jumpy touchpads out there, but this doesn't apply to all non-Macbooks, by far.
Mac allows the cursor to move quickly, but where it differs & excels is how fast it decelerates or stops the cursor.
On Linux, I am always overshooting what I'm trying to click on even when I make the mouse tracking speed very very slow. On Mac I can keep the tracking speed high and jump around quickly but still manage to stop right where I need to every time.
So either, it's faster to register you're slowing down/stopping OR it slows down at a faster rate than your finger is slowing down (vs faithfully tracking your finger)... or both?
Edit: This is true for the handling of external mice too, it's not just the trackpad. The difference is night and day, and overshooting things is frustrating with a normal mouse as well as the touchpad.
Things I've noticed:
- Mouse jumps after thumb-clicking.
- Thumb doesn't get ignored when doing certain combination actions (thumb + click and drag to select multiple items).
- Scrolling isn't 'inertial'
- Mousing around lacks some of the accelation/deceleration that makes getting around a screen easier.
(bias: I spent a lot of time thinking about the mac touchpad and once wrote an app leveraging it's privateframework data).
I'm really tempted to find time to help on this effort, but it likely requires getting another machine since I can't see myself living in linux full-time for a while.
> Scrolling isn't 'inertial'
It seems different applications have different scrolling settings. I'm on Ubuntu, on Firefox there is inertial scrolling (smooth scrolling setting), on Chrome there isn't.
I get this one on Windows with my touchpad (with Microsoft's 'precision' driver) but not Linux.
One that I don't like about the Macbook touchpad is that the cursor won't move for a short period after clicking, which makes it hard to click stuff quickly
Because of their low resolution, windows scrolling is done one text line at a time, while macs scroll a pixel at a time.
This sounds superficial, but it is really not. With the higher resolution, you get a very direct connection with the scrolled content. Without this almost tactile feedback, inertial scrolling doesn’t work at all.
And since scrolling is like 90 % of what I use a trackpad for, I will not even consider using windows with a trackpad until they have fixed it.
This behaviour one of the things in Mac OS that nobody really notices because it feels so intuitive, but if you took it away everyone would be puzzling over why scrolling feels broken.
I think the story is similar for Windows, but a little less satisfying since their hodepodge of UI toolkits starts from the very core, whereas at least with modern desktop Linux distros the core apps are generally implemented the same way.
Alas, mouse wheels are a whole other story. Pixel perfect scroll wheels have been a thing for a while, and Windows actually has support for these (not that it works anywhere). Support in Linux has been progressing at a similarly glacial pace, but it looks really promising. That's one spot where Apple is definitely years ahead. (If only they would make a practical mouse…).
No longer true. Windows 10 works pretty well as long you use precision trackpad, or use an apple touchpad with a third party driver (https://github.com/imbushuo/mac-precision-touchpad , https://magicutilities.net )
There is not a similar effect in other applications.
I stopped buying Macs due to the ESC key, the butterfly keyboard, the touch bar, and the removal of USB-A ports, so I'm very happy to have the Precision 55xx options.
Strangely enough, my only other laptop whose trackpad as almost as good as the Mac is my cheapo Chromebook.
There is a much better option than the trackpad mac or otherwise built in ;-)
You can observe this effect by comparing a magic trackpad 2 vs the internal macbook trackpad, when connected over bluetooth: there is a small but noticeable latency that makes the external trackpad less precise and less "fun" to use than the internal one.
Edit: you can observe the same difference between a standard corded mouse vs a bluetooth mouse. Or, in my case, a 125Hz USB mouse vs my PS2 mouse back in the Windows XP days - the difference was night and day.
Let's put it this way: the one accessory that's in my Linux laptop's bag that isn't in my MacBook's bag is a wireless mouse.
"Here, it's moving, what else do you want?"
The input experience in Linux is an example of the "Soviet style" pattern. Quoting the "Adrenaline Junkies and Template Zombies" book:
"You have probably used some of these Soviet-style products that do more or less what they are intended to do but in a way that you find awkward or irritating. You find that the products’ usability is not what it should be; their look and feel is unattractive; they lack certain security aspects you feel are needed; or they contain cultural references you find disconcerting or offensive. These are failures to meet the products’ non-functional requirements—those that make them appealing to the humans who use them. Such requirements are every bit as important for eventual acceptance as the functional requirements."
Whys and hows of this are also explained in this attempt: https://www.artlebedev.com/mandership/172/. TL;DR is that to make a good design for anything, be it a city park, or a gas stove, or a software product, you need to widen your comfort zone to include other people besides yourself.
1) Size. I have huge hands. A 2015 MBP has a trackpad whose size I have yet to see on any Windows/Linux laptop. I'm too clumsy for IBM's trackpad and the tiny "touchpads" on usual laptops should rather be called "touchpadlets" because they are so small that most I have experienced have had my fingers awkwardly collide. I won't go back on non-Apple hardware until there is a decently wide offering of decently sized touchpads.
2) Drivers. Back with my last Windows laptop it was some Elantech touchpad with Elantech drivers. Installing some random drivers from some random other laptop on a forum hint somewhere in the 30th Google result area suddenly gave me a whole lot of gestures. Just... WTF? Why is this not a core OS component in Windows and has it been possible over the last five years (since I switched) to finally use gestures OOTB in Linux?!
3) OS primitives / integration. Windows and (IIRC, please correct me!) Linux operate on the concept of "steps" with absolute scroll delta values, while OS X (and iOS/Android) operates on ... I don't even know what, it simply feels utterly smooth instead of janky. But I also assume that this is the most difficult to fix :(
One think I dont like about them though, is that I have to make the choice whether the middle button is native windows scroll, or thinkpad scroll. The native scroll allows me to middle click links, tabs, windows, but has a delay that makes it almost unusable for scroll. The thinkpad scroll is beautiful, but now the button doesnt function as middle click.
If I choose to use native windows scroll, I end up using 2 finger scroll on the touchpad to counter the trackpoints inability to scroll correctly.
exec xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Synaptics Tap Action' 1 1 1 1 1 1 1 &
exec xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Synaptics Two-Finger Scrolling' 1 1 &
exec xinput set-prop 'TPPS/2 IBM TrackPoint' 'libinput Accel Speed' -.3 &
exec xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Synaptics Coasting Speed' 0 0 &
Sure, it could be more fine-tuned, but it works just fine that way.On other laptops I've had to reduce the "finger size" (I can't remember the name of the setting), so I could use it even with a light touch, but that's the biggest problem I've had with it so far.
$ cat ./a.sh
#!/bin/sh
exec /bin/echo foo &
exec /bin/echo bar &
which outputs foo and bar. Seems like a special case, just like exec without a command for file descriptor redirection.1) how exactly are you planning to cooperate with upstream (meaning Peter Hutterer, meaning Red Hat)? Suppose someone does the work, then what? libinput has issues open for years, including issues that have patches, how are you going to make sure yours is not going to get buried?
2) if there existed a programmer both capable and willing to pull this off, wouldn’t it make sense for them to set up sponsorship themselves and cut the middleman out?
> I presume nobody is randomly visiting pages on bill.harding.blog, so you aren't seeing this.
Edit: some formatting
I actually can't think of the last time I misclicked a right click on Mac.
Maybe they optimize to the wrong finger size to the point you can't even if you try, and i trigger the bug too often.
With a tool like Fusumu (https://github.com/iberianpig/fusuma) I am using three finger and four finger gestures just fine!
Hoping all Linux input libraries will get a lot more attention and funding in the future :)
And software doesn't even touch the problem that most of what's wrong with non-Mac touchpads is the universally lousy hardware.
Perhaps I should clarify: the difference is also a difference in usage: on the Chromebook I use the trackpad almost exclusively to select the current window or scroll its content, rarely set the cursor or highlight some text to be copied (the latter is already more challenging than with a mouse, I'd say). I haven't attempted to use a CAD program using the touch pad yet. So the touchpad works mostly fine for what a Chromebook is useful for, it's no replacement for a mouse on a workstation.
in any case I blame propietary vendors for preventing better open source support.
https://public.amplenote.com/HbcoZf/touchpad-results-prelim
Average satisfaction looks to be around 2 of 5. People are excited about multi-touch, especially the double finger right click.
Personally, I hate the feel of MacOS. The cursor seems unnaturally slow and when you crank up the speed has some weird behaviour.
They want to hire a developer to fix the issues identified by the survey.
That is, hacking in an old tactile (non-touchpad) keyboard into the top section of the latest Macbook Pros.