Package Firefox with MOZ_USE_XINPUT2=1 in environment to enable pixel scrolling with touchpad and touch gestures

Bug #1697122 reported by Nate Graham on 2017-06-10
88
This bug affects 18 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Confirmed
Medium
firefox (Ubuntu)
Wishlist
Olivier Tilloy

Bug Description

Ubuntu version: Kubuntu 17.04
Firefox version: 53.0.3+build1-0ubuntu0.17.04.2

In Firefox, two-finger scroll gestures on a touchpad are interpreted as scroll wheel rotations, and the content scrolls three lines at a time. This is inappropriate behavior for touchpad scrolling; it should scroll pixel-by-pixel.

Firefox already has the ability to do this, you just need to turn it on by running the program with MOZ_USE_XINPUT2=1 in the environment: for example, by running `MOZ_USE_XINPUT2=1 firefox`, or adding it to /etc/environment or something like that.

Turning on this behavior yields a large usability improvement for laptop users. Therefore, I am proposing that MOZ_USE_XINPUT2=1 be permanently added to the packaging such that it's always present when Firefox runs. This is what Fedora does, and it results in a much improved experience for the laptop user.

We had to disable XI2/multidevice support in bug 1170342 due to focus and scrolling related issues. We should monitor these issues to see if it would be possible to re-enable XI2 in the future.

Please add option to reenable via about:config or something - I'm really got used to it...

(In reply to Kuba Niewiarowski from comment #1)
> Please add option to reenable via about:config or something - I'm really got
> used to it...

Just set MOZ_USE_XINPUT2=1 env variable which enables it in Firefox.

(In reply to Martin Stránský from comment #2)
> Just set MOZ_USE_XINPUT2=1 env variable which enables it in Firefox.

Not working...
I'm using Aurora builds from https://launchpad.net/~ubuntu-mozilla-daily/+archive/ubuntu/firefox-aurora

MOZ_USE_XINPUT2=1 is in Nightly (bug 1207973) but not yet in Aurora.

*** Bug 1234005 has been marked as a duplicate of this bug. ***

Using "MOZ_USE_XINPUT2=1" &e10s worked for me (https://bugzilla.mozilla.org/show_bug.cgi?id=1268599#c10), but not very smooth (scrolling, afterwords opening the menu item, then trying to scroll results in an un-scrollable page). Fedora already compiles FF with "MOZ_USE_XINPUT2=1", which is very smooth on my tablet.

However, it would be interesting how this is handled by Firefox for Android, which clearly needs touch support and XINPUT2.

Adolfo Jayme (fitojb) wrote :
Changed in firefox (Ubuntu):
importance: Undecided → Wishlist
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in firefox (Ubuntu):
status: New → Confirmed

*** Bug 1390130 has been marked as a duplicate of this bug. ***

I think we can enable the XInput2 for recent Gtk+ versions (say Gtk+ >= 3.20) as the related Gtk+ focus bugs was fixed but for XInput2 only. Also Fedora enables XInput2 by default and we don't have any user complains.

Before the switch we need to address Bug 1182700. Bug 1170342, Bug 1196777 should be fixed for reasonable recent systems.

For Bug 1182700 looks like gnome folks gave up (https://bugzilla.gnome.org/show_bug.cgi?id=750994#c8) and recommend to use Wayland. I wonder how big complication is it and if benefits from enabled xinput2 outweigh it, especially when the focus bugs should be fixed on recent systems.

Andreas Enström (anen) on 2018-04-20
summary: - Package Firefox with MOZ_USE_XINPUT2=1 in environment
+ Package Firefox with MOZ_USE_XINPUT2=1 in environment to enable touch
+ gestures

Gnome issue 750994 has been migrated to their Gitlab instance:
https://gitlab.gnome.org/GNOME/gtk/issues/558

Counter-argument: Try to zoom in on a PDF with this option on. (It goes in increments of 10% *per pixel*.)

This could be considered a bug on Firefox though, so I guess as soon as those little things are polished this change could be made (but then again I guess the Firefox devs would include this option by default themselves).

summary: - Package Firefox with MOZ_USE_XINPUT2=1 in environment to enable touch
- gestures
+ Package Firefox with MOZ_USE_XINPUT2=1 in environment to enable pixel
+ scrolling with touchpad and touch gestures
Florian Boucault (fboucault) wrote :

It is indeed a common complaint/request as evidenced by the people talking about it in various places (blogs, reddit, etc.):
https://www.rojtberg.net/1569/switching-back-from-chrome-to-firefox/
https://www.reddit.com/r/linux/comments/72mfv8/psa_for_firefox_users_set_moz_use_xinput21_to/
https://hackido.com/2019/02/01/2019-02-01-firefox-with-touch/

I paste here again the upstream bug report as the link changed slightly: https://bugzilla.mozilla.org/show_bug.cgi?id=1207700
Recent comments in it (a year old) are fairly positive:
"I think we can enable the XInput2 for recent Gtk+ versions (say Gtk+ >= 3.20) as the related Gtk+ focus bugs was fixed but for XInput2 only. Also Fedora enables XInput2 by default and we don't have any user complains."
However there is a list of possible issues that need to be checked before moving on this:
https://bugzilla.mozilla.org/show_bug.cgi?id=1182700 (wheel scrolling issue when window not active)
https://bugzilla.mozilla.org/show_bug.cgi?id=1390795 (wheel scrolling issue when window not active)
https://bugzilla.mozilla.org/show_bug.cgi?id=1487882 (pdf zoom increments by 10%)
https://bugzilla.mozilla.org/show_bug.cgi?id=1196777 (probably fixed)
https://bugzilla.mozilla.org/show_bug.cgi?id=1170342 (fixed)

Additionally, we need to check it works adequately when the synaptics driver is enabled (I'm not sure but perhaps it's enabled by default on Macbooks?).

Finally, I tried a couple more tweaks in about:config to make the scrolling experience smoother with a touchpad:
- disabling smooth scrolling: general.smoothScroll = false
OR
- enabling msdPhysics scrolling: general.smoothScroll.msdPhysics.enabled = true
I'm not yet entirely convinced by either and still have to test it more, especially with a mouse.

Florian Boucault (fboucault) wrote :

For completeness sake, here is the OpenSuse bug report talking about it:
https://bugzilla.opensuse.org/show_bug.cgi?id=1032003

Florian Boucault (fboucault) wrote :

Quick workaround for those who want to enjoy the benefits right away:
echo "MOZ_USE_XINPUT2=1" | sudo tee /etc/environment.d/90firefox-xinput2.conf

Olivier Tilloy (osomon) on 2019-05-09
Changed in firefox (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
Nate Graham (pointedstick) wrote :

BTW I've since changed my mind on this. Setting the proposed environment variable makes toupad scrolling mysteriously slow down after a notification arrives until you switch focus away from Firefox and back (See https://bugzilla.mozilla.org/show_bug.cgi?id=1182700). This problem is particularly severe for mouse scroll wheel users, where wheel scrolling breaks entirely until you switch away and back again.

I grudgingly live with the issue when I'm using a touchpad, but I unset the envar when I'm using a mouse because of how bad it is.

I think https://bugzilla.mozilla.org/show_bug.cgi?id=1182700 needs to be fixed upstream before this can be considered. Unfortunately, it's blocked on a GTK issue (https://gitlab.gnome.org/GNOME/gtk/issues/558) that the GTK developers have declared unfixable on X11.

Nate Graham (pointedstick) wrote :

So I recommend closing this bug, or else devoting some Canonical development resources to fixing the above-mentioned upstream bugs first.

uman (brennan-vincent) wrote :

If this bug is not going to be fixed soon, I suggest Ubuntu should bundle another browser in the next release.

Maybe it doesn't make a difference for people who are not used to using a touchpad on other browsers (or Firefox on other OSes), but this bug made Ubuntu-on-laptop absolutely maddening to use for me and I assume for many others as well.

Nate Graham (pointedstick) wrote :

it's annoying for me too. The problem is that setting the envar just substitutes some problems with different ones:
- Without this envar set, there is no touchscreen scrolling, and touchpad scrolling goes three lines at a time rather than pixel-by-pixel
- With this envar set and a notification appears, touchpad scrolling is interrupted and mouse wheel scrolling stops working entirely until Firefox is de-focused and re-focused

The correct solution is to fix these bugs, not toggle between two broken states. Chromium has different scrolling bugs, BTW.

Changed in firefox (Ubuntu):
status: Confirmed → Invalid
Olivier Tilloy (osomon) on 2019-06-03
Changed in firefox (Ubuntu):
status: Invalid → Confirmed
Daniel van Vugt (vanvugt) wrote :

Note we already have bug 1312376 covering touchscreen support. This bug should be about touchpads.

tags: added: eoan
tags: added: bionic
tags: added: performance
Changed in firefox:
importance: Unknown → Medium
status: Unknown → Confirmed

*** Bug 1597218 has been marked as a duplicate of this bug. ***

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.