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

Bug #1697122 reported by Nate Graham
104
This bug affects 22 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Confirmed
Unknown
firefox (Ubuntu)
Triaged
Wishlist
Unassigned

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.

Revision history for this message
In , Atdrew (atdrew) wrote :

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.

Revision history for this message
In , Kuba Niewiarowski (marsjaninzmarsa) wrote :

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

Revision history for this message
In , Stransky (stransky) wrote :

(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.

Revision history for this message
In , Kuba Niewiarowski (marsjaninzmarsa) wrote :

(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

Revision history for this message
In , Anders Kaseorg (andersk) wrote :

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

Revision history for this message
In , Karlt (karlt) wrote :

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

Revision history for this message
In , sacharja (c3521333) wrote :

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.

Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :
Changed in firefox (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
In , Karlt (karlt) wrote :

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

Revision history for this message
In , Stransky (stransky) wrote :

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.

Revision history for this message
In , Stransky (stransky) wrote :

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

Revision history for this message
In , Stransky (stransky) wrote :

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)
summary: - Package Firefox with MOZ_USE_XINPUT2=1 in environment
+ Package Firefox with MOZ_USE_XINPUT2=1 in environment to enable touch
+ gestures
Revision history for this message
In , Shu Hung (Koala) (koalay) wrote :

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

Revision history for this message
cousteau (cousteaulecommandant) wrote : Re: Package Firefox with MOZ_USE_XINPUT2=1 in environment to enable touch gestures

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
Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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)
Changed in firefox (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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)
Changed in firefox (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
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
Revision history for this message
In , Botond-2 (botond-2) wrote :

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

tags: added: focal
Revision history for this message
mlaverdiere (mlaverdiere) wrote :

Still a problem on Ubuntu 20.04 beta, which prevent smooth scrolling in Firefox.

This bug is not present in some other major distribution, like Fedora.

As reported in https://bugzilla.mozilla.org/show_bug.cgi?id=1207700

"Fedora enables XInput2 by default and we don't have any user complains."

Revision history for this message
In , Qwerty Chouskie (asdfghrbljzmkd) wrote :

Is there any possibility of enabling this soon? Out-of-the-box Firefox is unusable with touchscreens, and as touchscreens become more common (e.g. I just upgraded my laptop to one that has a touchscreen), having this enabled quickly becomes quite important for a large number of users. Also, https://bugzilla.mozilla.org/show_bug.cgi?id=1182700 was just fixed in Kwin, and AFAIK that was the last blocker of this bug.

Also, AFAIK, Fedora enables MOZ_USE_XINPUT2 by default for these reasons, so apparently it's not too buggy :P

Revision history for this message
In , Qwerty Chouskie (asdfghrbljzmkd) wrote :

After some more thinking, it would probably make sense to enable it by default but disable it for KWin < 1.19.3, so those users don't get hit by the bug.

Revision history for this message
In , Botond-2 (botond-2) wrote :

(In reply to QwertyChouskie from comment #13)
> Also, https://bugzilla.mozilla.org/show_bug.cgi?id=1182700 was just fixed in Kwin, and AFAIK that was the last blocker of this bug.

Based on comment 10, it sounds like Gnome is affected as well, and the issue is not fixed there?

Revision history for this message
In , Qwerty Chouskie (asdfghrbljzmkd) wrote :

I am unable to reproduce using the steps in https://bugzilla.gnome.org/show_bug.cgi?id=750994#c0 with my laptop's touchpad, tested on Gnome Shell 3.36 (Ubuntu 20.04). I tried the same steps with FF and also can not reproduce it there. I suspect the bug was mitigated/had its impact lessened (perhaps unintentionally) in Gnome at some point, which then left the issue for KDE users (as per most of the comments in https://bugzilla.mozilla.org/show_bug.cgi?id=1182700).

Revision history for this message
In , Qwerty Chouskie (asdfghrbljzmkd) wrote :

(Also FYI, the KWin fix was just backported to the 5.18 series, so it should be fixed in the next 5.18.x point release, meaning Ubuntu 20.04 and its derivatives should get this fix soon.)

Revision history for this message
In , Botond-2 (botond-2) wrote :

Martin, WDYT? Based on the above info, should we enable XInput 2 for KWin >= 5.19.3 (and >= 5.18.next)? How about other window managers?

Revision history for this message
In , Stransky (stransky) wrote :

(In reply to Botond Ballo [:botond] from comment #18)
> Martin, WDYT? Based on the above info, should we enable XInput 2 for KWin >= 5.19.3 (and >= 5.18.next)? How about other window managers?

Fedora has used XINPUT2 by default for five years and I don't have any reports so I guess it's okay to enable it for recent systems, at least for KDE/Gnome.

Revision history for this message
In , Botond-2 (botond-2) wrote :

(In reply to Martin Stránský [:stransky] from comment #19)
> Fedora has used XINPUT2 by default for five years and I don't have any reports so I guess it's okay to enable it for recent systems, at least for KDE/Gnome.

Thanks!

(As this bug is assigned to you, I assume you'll write the enablement patch, but please let me know if you'd like me to.)

Revision history for this message
In , Stransky (stransky) wrote :

Created attachment 9169828
Bug 1207700 [Linux] Enable XInput2 on Gtk 3.24 and newer, r?botond

Revision history for this message
In , Pulsebot (pulsebot) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/integration/autoland/rev/6c7f2177e485
[Linux] Enable XInput2 on Gtk 3.24 and newer, r=botond

Revision history for this message
In , Apavel-2 (apavel-2) wrote :
Changed in firefox:
status: Confirmed → Fix Released
Changed in firefox (Ubuntu):
status: Confirmed → Fix Committed
tags: added: fixed-in-81 fixed-upstream
removed: eoan
Revision history for this message
In , Stransky (stransky) wrote :

Let's revert that in Bug 1660212.

Revision history for this message
In , Mathew Hodson (mhodson) wrote :

This bug should probably be reopened since the change was completely reverted.

Changed in firefox:
status: Fix Released → Confirmed
Changed in firefox (Ubuntu):
status: Fix Committed → Triaged
tags: removed: fixed-in-81 fixed-upstream
Revision history for this message
mlaverdiere (mlaverdiere) wrote :

Still not working in Ubuntu 20.10 with Firefox 82.

Revision history for this message
In , Pier Paolo (pierpaolo-franco) wrote :

(In reply to Mathew Hodson from comment #25)
> This bug should probably be reopened since the change was completely reverted.

Confirmed. Need to set environment variable in Debian 11 with Firefox 78.12.0esr (64 bit).

Changed in firefox:
importance: Medium → Unknown
Revision history for this message
In , Release-mgmt-account-bot (release-mgmt-account-bot) wrote :

The severity field for this bug is relatively low, S3. However, the bug has 3 duplicates, 22 votes and 50 CCs.
:stransky, could you consider increasing the bug severity?

For more information, please visit [auto_nag documentation](https://wiki.mozilla.org/Release_Management/autonag#severity_underestimated.py).

Revision history for this message
In , Autonag-nomail-bot (autonag-nomail-bot) wrote :

The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.

Olivier Tilloy (osomon)
Changed in firefox (Ubuntu):
assignee: Olivier Tilloy (osomon) → nobody
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Surprisingly still not fixed in Firefox 111 on lunar. We all just failed to notice because forcing it to use native Wayland is a workaround.

tags: added: jammy lunar
tags: added: udeng-1089
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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