Open Bug 1568722 Opened 5 years ago Updated 9 months ago

Kinetic scrolling on Linux ought to stop on two-finger touch (hold gestures)

Categories

(Core :: Widget: Gtk, enhancement, P3)

69 Branch
Unspecified
Linux
enhancement

Tracking

()

People

(Reporter: ryan.hendrickson, Unassigned)

References

(Depends on 1 open bug)

Details

Spinning this bug off from my comment on bug 1213601:

[O]nce a two-finger fling has begun, I expected that touching the trackpad again with two fingers would stop the fling immediately, like on macOS (I see from bug 1554456 that this briefly regressed, but that looks fixed now). Instead, it seems that I have to actually scroll a little bit to stop it.

It appears that this would be blocked on a new libinput event type being defined, but if and when libinput makes that change, and GTK adds it to their API, Firefox should support it.

OS: Unspecified → Linux
Priority: -- → P3

Bugbug thinks this bug is a enhancement, but please change it back in case of error.

Type: defect → enhancement

I double-checked that Firefox doesn't currently receive any events when the fingers touch down in such a case, suggesting that we do indeed need to wait for the mentioned libinput / GTK enhancements to make this work.

Depends on: 1213601
Status: UNCONFIRMED → NEW
Ever confirmed: true

Hello,

I just wanted to mention, Chrome's Wayland implementation somehow offers this functionality already. Could someone familiar with Chromium see how they're doing this so that FF might implement this feature in a similar fashion?

(In reply to Ari from comment #3)

I just wanted to mention, Chrome's Wayland implementation somehow offers this functionality already.

Could you provide some details on your Chrome version, how you're running it (to get it into Wayland mode), and your desktop environment please?

I tested this with Chrome 89, run with the --enable-features=UseOzonePlatform --ozone-platform=wayland command line flags to get it into Wayland mode, on Debian 10 in a "GNOME (Wayland)" session, and touching my fingers down did not stop kinetic scrolls.

(In reply to Botond Ballo [:botond] from comment #4)

(In reply to Ari from comment #3)

I just wanted to mention, Chrome's Wayland implementation somehow offers this functionality already.

Could you provide some details on your Chrome version, how you're running it (to get it into Wayland mode), and your desktop environment please?

I tested this with Chrome 89, run with the --enable-features=UseOzonePlatform --ozone-platform=wayland command line flags to get it into Wayland mode, on Debian 10 in a "GNOME (Wayland)" session, and touching my fingers down did not stop kinetic scrolls.

I just realized one thing that I should have really mentioned. It didn't cross my mind until just now. If you look at the mentioned libinput issue, one of the developers was nice enough to give me a patch that introduces the feature for libinput. (Although it is important to mention he has stated the patch is "hacky" and is not appropriate for widespread use.)

The Wayland version of Google Chrome (using the flags you mentioned), can somehow handle the feature from this patch while Firefox cannot. So, I don't think it maters as much any more given the patch is intended as a quick fix.

I'm still sort of curious how Chrome is doing this while Firefox isn't, but I'm guessing that's just up to how each browser has started working with Wayland.

Sorry for the confusion.

Some upstream progress here:

  • The libinput issue for introducing hold gestures has been fixed.
  • The next step is for GTK to add support for hold gestures -- there is an open merge request for it.
  • Once the GTK support lands, supporting it becomes actionable in Firefox.

(In reply to Botond Ballo [:botond] from comment #7)

  • Once the GTK support lands, supporting it becomes actionable in Firefox.

The merge request you referenced has bin closed and merged. So GTK support has landed, correct?

(In reply to franz.srambical from comment #8)

(In reply to Botond Ballo [:botond] from comment #7)

  • Once the GTK support lands, supporting it becomes actionable in Firefox.

The merge request you referenced has bin closed and merged. So GTK support has landed, correct?

As far as I can tell, no. The GTK merge request in question is this one and its status is still open. Looking at an example change it makes (like adding a new enumerator named GDK_TOUCHPAD_HOLD to enum GdkEventType in gdk/gdkevents.h), that change is not present in the gdk/gdkevents.h file on GTK trunk.

Good news -- the GTK merge request has landed! Are changes needed in Firefox to make use of this, or will we get it for free?

Note that the MR (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3454) only landed in GTK4 yet. It would first need to get backported to GTK3 and then IIUC we'd need to handle the new GdkEventType GDK_TOUCHPAD_HOLD.

(In reply to Robert Mader [:rmader] from comment #12)

Note that the MR (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3454) only landed in GTK4 yet. It would first need to get backported to GTK3

Ohh good point, I didn't consider that.

and then IIUC we'd need to handle the new GdkEventType GDK_TOUCHPAD_HOLD.

It looks like that might be handled in GTK? There's a gtk_kinetic_scrolling_stop added in the patch. I can't make out for sure if it's actually wired up to GDK_TOUCHPAD_HOLD though. Also maybe Firefox overrides/ignores GTKs built in scroll functionality?

(In reply to eeshugerman from comment #13)

Also maybe Firefox overrides/ignores GTKs built in scroll functionality?

Yes, of course Firefox uses its own implementation (APZ). Firefox isn't made out of GTK widgets, the GTK window only provides a drop shadow :) and is generally just a canvas for WebRender.

(In reply to eeshugerman from comment #13)

It looks like that might be handled in GTK? There's a gtk_kinetic_scrolling_stop added in the patch. I can't make out for sure if it's actually wired up to GDK_TOUCHPAD_HOLD though. Also maybe Firefox overrides/ignores GTKs built in scroll functionality?

Not an expert here, but we generally use relatively little GTK (the actual toolkit) and a lot more of GDK (the backend/OS abstraction) in Firefox. We do already handle different kinds of GDK_SCROLL_* and GDK_TOUCHPAD_* events - this will likely be no exception.

P.S.: ah, already too late :)

Nice to see upstream progress here!

Robert and others are correct to point out that we'll need a Firefox patch to handle the new GDK_TOUCHPAD_HOLD event in our code.

Please feel free to ping the bug again when the backport to GTK3 happens, to give us a heads up to get on that.

Got it, thanks all for the info!

Please feel free to ping the bug again when the backport to GTK3 happens, to give us a heads up to get on that.

From a recent discussion on GitLab, it seems hold gestures won't be backported to GTK 3. See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3454#note_1426517

That would mean that hold gestures won't be coming until after FF has moved to GTK 4, right?

(In reply to Christian Kaindl from comment #18)

Please feel free to ping the bug again when the backport to GTK3 happens, to give us a heads up to get on that.

From a recent discussion on GitLab, it seems hold gestures won't be backported to GTK 3. See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3454#note_1426517

That would mean that hold gestures won't be coming until after FF has moved to GTK 4, right?

Yes, and unfortunately, based on the discussion in bug 1701123, it doesn't look like Firefox will be ported to GTK4 in the near future.

I commented on the GitLab merge request in the hope they might reconsider the GTK3 backport.

Severity: normal normal → S3 S3

(Adding "hold gestures" to the bug title to make this bug easier to find)

Summary: Kinetic scrolling on Linux ought to stop on two-finger touch → Kinetic scrolling on Linux ought to stop on two-finger touch (hold gestures)
You need to log in before you can comment on or make changes to this bug.