Ubuntu – Ubuntu 16 and touchscreen scrolling in FireFox


I have noticed that touchscreen doesn't work in FireFox on Ubuntu 16 desktop (on a touchscreen laptop), which is a major bummer as I am a FireFox guy and the browser is 90% of what I use my personal computer for. Note that it works on non-linux FireFox and it works in Chrome/Chromium on Ubuntu.

I have done some research on this and found a lot of people with the same complaint 2 – 3 years back. In those cases the consensus was typically that FireFox just lacked some necessary technology to support this (some say GTK 3, others said something else). However they claimed that this issue was already fixed in the pre-released FF v50. Now FF 50 is out and I'm running it but it still doesn't work.

Is there something I can add, an Alpha / Beta / Dev / Nightly version I can use, or something I can do to Ubuntu itself to get this to work?

Best Answer

Found this solution elsewhere: if I start firefox from the command line with

env MOZ_USE_XINPUT2=1 firefox

then touchscreen scrolling works for me. To avoid having to start firefox from the command line, you can edit the Unity app launcher exec code to include this. Default .desktop resides in /usr/share/applications but we'll copy it over to our home folder so that the changes we make are immune to be overriden by the package manager on update.

cp /usr/share/applications/firefox.desktop ~/.local/share/applications/
gedit ~/.local/share/applications/firefox.desktop

find the Exec line in the [Desktop Entry] section and change it to

Exec=env MOZ_USE_XINPUT2=1 firefox %u

Change the other exec lines too, if you feel like it. Those affect the options in the right-click menu.

EDIT: At some point this stopped working (I think because of an extension I installed). To fix it, I had to go to about:config in the browser, right-click, add a new boolean browser.tabs.remote.force-enable set to true. Warning: this is not recommended and could break stuff.