Live data from Hacker News

Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

gitclear.com

271–280 of 284 posts

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#271

Earlier quoted context omitted.

I gave it a try. The difference is that XINPUT2 scroll has inertia: I start scrolling, remove the fingers from the touchpad and it keeps scrolling for a while. If I want to stop when I see something interesting I have to click or it will scroll away. That adds an extra action that must performed at the right time. I don't think I like that because this is not a videogame and Firefox is not supposed to challenge my ab…

Try it for some longer time. Scrolling on Macbook becomes subconscious. I don't think about it anymore. I don't even notice that I am moving my fingers. The scroll pane just moves where I want it to move. Simulating the behavior of physical objects allows our minds to reuse what it learned about the physical world. That is imho a very powerful user interface metaphor. But beware, this is just an anecdote.

There are two other problems I thought about later:

1) It's too fast. My Android phone also scrolls like XINPUT2 but it's got a smaller acceleration. But maybe it's what you say about getting used to it.

2) That would work in Firefox and every other window would still scroll in the other way. That's really bad and works against getting used to a specific scrolling behavior. I don't get it: the scrolling behavior should be managed at a level below every application. All the scrollbars should behave in only one way, except the random application that implements its own logic because of some important reason. So I would expect a system wide setting for XINPUT2 or traditional scrolling.

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#272
post #87
post #4

Apple has been perfecting its trackpad software since 1994, and it’s been getting better ever since. By contrast Apple keyboards have gotten worse since 1995 when it discontinued the Apple Extended Keyboard II. We don’t talk about Apple’s mice.

Yep. The TouchPads from Apple are good. Their keyboards are bad. There are two important I/O devices in a laptop, the keyboard and the display. The keyboards from ThinkPads are near perfect and don’t fall apart. Lenovo decided to remove the 7th row to acquire more space for the TouchPad. Which is a design mistake because TouchPads don’t get better by becoming just bigger. I never use the TouchPad in my ThinkPad. I me…

wait, _THAT_ was the reason they removed the 7th row?? those m... But jokes aside, I read it saving them money in manufacturing cost was the reason. Would have loved to be a fly on the wall around David Hill when he pushed for the t25 to get a 7row, my feeling is that it is what made him leave lenovo

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#273

Why does this seem like such a hard problem to solve for everyone that isn’t Apple, when Apple seemingly solved the Trackpad over a decade ago? Is this it? An unknown ROI? >the highly uncertain ROI for trying to align touchpad acceleration has prevented us from proposing a system change to the default Linux settings. I can only speak for myself, but I gave up using trackpads on anything that isn’t a MacBook many year…

It isn't... You can see this in an open source JavaScript implementation of kinetic scrolling by Apple called PastryKit[3] using a magic number momentum * 0.9. The problem is, that on modern Linux environments, there is no clear responsibility for where scroll handling code belongs. Especially Kinetic / Inertial scrolling is handled way different than in macOS. There is libinput (for handling and redirecting input ev…

This explains a lot. Thanks so much! This is a rabbit hole I didn’t want to go in a few years back. Some people would say they had issues, others didn’t. Would’ve taken me a lot of time to figure out that we all may be talking about different DEs, apps, etc.

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#274

Earlier quoted context omitted.

> How do you make an OS where the main pointing device on half of the market sucks and assign that low priority? Because Linux isn't "an OS". It's a kernel made by one set of developers, combined with a bunch of operating systems made by a second set of developers, which pick and choose compositors/window managers/etc. often made by a third set of developers. Each of these sets of developers are pretty good at solvin…

That's why I mentioned Ubuntu; if anyone has incentive and resources to contribute to all these projects and get smooth scrolling working it's Canonical. If _they_ can't, I guess that means the whole community is screwed on that side. Maybe it's going to work 20 years from now, when we've moved on from trackpads to AI voice interfaces.

In 20 years there will be so much baggage to fix that we’ll be at the same point we are now “ugh but you have to rewrite everything from the ground up and update so many programs…”

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#275
post #127
post #68

Earlier quoted context omitted.

This basically makes their mice unusable for certain things like gaming. I had to use their mouse for a while and I opted to bind right click to a keyboard button because what do you know, most games bind aim and shoot to right and left click.

Apple has never prioritized gaming on their devices.

There was once a time when Halo was a first party release pitched at MacWorld.

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#276
post #65

Earlier quoted context omitted.

>I believe that the 3D Touch tech that was once in the iPhone is the same tech that is in the track pad and the Apple Watch 3D touch was only in the iphones for a few years, it was too expensive so they cut it in favor of the haptic touch they have now. The macbook trackpad is nice but honestly I prefer the old 2012 one they had with the actual physical button you could tweak the pressure of with a screwdriver. It se…

I’m sorry what You can adjust the pressing force required in software, and the glass does in fact depress under your finger. It’s cushioned - that’s how they detect pressure.

You can choose three settings instead of an arbitrary level of adjustment with the old screw system. It used to be super easy in the very first round of unibodies, practically tooless except for the screwdriver on the trackpad since the battery came out with a finger latch at the time. Just shut the thing off and try it out, if it had cushioning you'd be able to tell then but its basically a slab of glass.

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#277
How can I test the improvements?

Wayland, XServer, Firefox, Gtk and QT patches were merged in 2021 already: https://bill.harding.blog/2021/06/06/linux-touchpad-like-mac...

But while running a current Debian unstable with Mate desktop, I don't know in which applications I could test the gestures, neither do I know which gestures are supported

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#278

Earlier quoted context omitted.

Putting the effort on the shoulders of App developers instead of solving it at one place leads to so much wasted developer time, that could have been put into new features or solved issues. I was shocked about how nobody seemed to notice that. However, they are not "hobby" at all. Peter Hutterer is awesome and he understands the problem very well - but as a single developer it's hard to convince a whole community Wai…

> I'm pretty sure Hutterer was the one who pushed it into the App layer. I'm not sure what he did and I'm not trying to do fingerpointing. I thought he just pushed it away from libinput stating that it's the wrong place to handle it and wanting to keep libinput as "clean" as possible - even if this might be a questionable argument in this case. To answer one of your other comments... > If you mark them with a "this i…

this would not help without changes in at least one of the other layers I mentioned (Compositor, Window Manager, Apps) to either ignore or handle these events

Yes, certainly. But it's basically one or two lines of code with zero configuration knobs:

    if (ev->is_synthetic && focus_changed_since_last_nonsynthetic) return;
Compare this to the current state of affairs, where every toolkit/compositor/app has to reimplement momentum scrolling on its own. That is multiple pages of fairly tricky code and several configuration knobs -- all of them replicated (differently) in each different thing that sits on top of libinput.

why should it be implemented in libinput?

Because libinput is the "narrow waist" in the input stack.

Doing this in libinput puts all the new configuration knobs, and all but one or two lines of code ("if focus changed then drop") in the one place where they can live without having to be duplicated.

Any higher up the stack and you end up replicating this functionality.

Issues would spread over two projects, instead of one and getting pushed back and forth.

I don't think so. If the problem is that a marked-as-synthetic event is/isn't being dropped when it shouldn't/should, that's the problem of some layer above libinput. Any other problem is libinput's. I know nobody wants to own these problems, but we can't make them disappear -- somebody has to own them. If they are owned at or below the libinput layer we can fix each bug once and be done. If we fix them anywhere above the libinput layer we will end up having the same bugs occur in multiple independent implementations and they will have to get fixed independently.

in my opinion it would have been better to implement it everywhere (with optional disable) instead of nowhere

I don't agree with this either. This "multiple reimplementations of the exact same thing" is becoming entrenched! We could get stuck in this situation, permanently. This isn't a question like "what should a titlebar look like" where different toolkits can legitimately have different opinions about it.

In my opinion the App layer is the wrong place

I agree.

Some part of this has to be done somewhere at-or-above the compositor layer, since those are the only layers that are aware of focus changes. Unfortunately there seems to be no traction for e.g. wayland to require that all compositors do this. So the replication gets amplified even further by pushing it up into every compositor or toolkit. That's why it's so important to limit the size of the bit that gets pushed up the stack to being two lines of code.

Perhaps a viable compromise would be to insert a new layer above libinput. For argument's sake, call it "libgesture" (*). It's responsible for consuming libinput events and emitting synthetic events like momentum scrolling. It would have exactly the same API as libinput, except events would have an additional `is_synthetic` field. I've actually built something similar to this (but at the kernel evdev level) for my own use.

Perhaps that would make everybody happy.

(*) This is unrelated to `libei` -- I have this sinking feeling that many apps (especially chromium) will reject any event that smells "emulated" to them "because muh bots" or something stupid like that. Trying to use libei for this is likely to backfire once the chromium devs decide that "emulated" means "bad for Web Environment Integrity". The indicator for gesture-synthesized events like momentum scrolling really needs to be completely separate from any marker indicating that the event was in any way emulated.*

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#279

Earlier quoted context omitted.

I'm a 100% trackpad user as well, and I also got into mechanical keyboards so my setups always look like this now: https://imgur.com/a/pmRO9r9 That one is an older magic trackpad, if it ever dies I'll upgrade to the newer one.

What's the two keyboards layout for? At first I suspected that they are two different keyboards, let's say US and some national layout, but they are both US. Maybe the black one is not connected and it's there only for the picture? Anyway, that's the keyboard/touchpad layout I would use too. The only difference is that I like touchpads with physical buttons. Three of them because I use Linux and pasting text with the…

Ah yeah, the extra keyboard was just there for the photo. I designed the PCB so I'm kinda proud of it :)

I agree that physical buttons are nice. The older magic trackpads actually are physical buttons, but they're on the underside of the trackpad, so the disadvantage there is you don't feel the button on the surface.

Re: Linux Touchpad Like MacBook Update: 2023 Progress on Smooth Scrolling

#280
post #179

Earlier quoted context omitted.

Yeah, no. Just tried on rando iPhone SE 1st gen I have here for some tests, and it lags on scrolling just like any other phone from similar era. You just slide back and forth slowly and observe the content of the screen pretty clearly not following the changes in direction immediately, and you can observe about 1-2cm distance between your finger and text. It's impossible to be in sync anyway, unless you avoid VSYNC,…

Sample size of 1 and whatnot, but this has absolutely never been my experience on my iphone 7, which I've kept up to date and stopped using less than a year ago. Scrolling in Mail, for example, was the contents following my finger. Hell, I complain about Android phones, even newer ones, which lag while scrolling the settings app, but even there I've never noticed that big of a distance between the finger and the text…

https://nanoreview.net/en/phone/apple-iphone-7

> Response time 35.5 ms

So at 60 fps, that's 2 frames delay + some. (and this is just display response time and doesn't include the content rendering, double buffering, and the input lag)

Here's the input lag for phones from similar era as the SE 1st gen: https://blog.gamebench.net/touch-latency-benchmarks-iphone-x... (88ms)

Another set of numbers: https://danluu.com/input-lag/

You can move your finger quite far in 80ms.

Post reply on HN