22

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?

28

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. For example, open

sudo gedit /usr/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.

  • 2
    In conjunction with XINPUT2=1, you might also need to go to about:config to set dom.w3c_touch_events.enabled=1 (default was 2). In my experience this enabled two-finger scrolling, while one finger still selects text. – Jeff G Mar 19 '17 at 2:49
  • 3
    Note that you need to make sure you have a thing called e10s enabled. To find out if you do, open about:support and look for 'Multiprocess Windows'. – BudgieInWA Jul 7 '17 at 8:13
  • 3
    There's also an (admittedly pretty stupid) alternate way to handle setting MOZ_USE_XINPUT2 - just add MOZ_USE_XINPUT2 DEFAULT=1 to /etc/security/pam_env.conf and then never worry about it again (probably) – rookie1024 Nov 26 '17 at 0:00
  • This worked without further modification for me on Firefox 57. Great! – DaVince Jan 4 '18 at 0:48
19

This worked for me (firefox 57.0.4, Arch Linux):

  1. open about:config in firefox to set dom.w3c_touch_events.enabled=1 (default is 2).

  2. edit /etc/security/pam_env.conf and add MOZ_USE_XINPUT2 DEFAULT=1

  3. reboot and restart firefox

(see also How can I get Firefox to recognize multitouch gestures on a touch screen? )

  • 9
    didn't need to edit about:config, setting the environment variable was enough. On FF60. – 3ventic May 21 '18 at 8:21
  • this works except you want to disable the gestures to zoom as well. it's annoying to use 2-finger scroll and while you're scrolling it zooms in/out on the content. You can do this by adding -disable to the end of the values for browser.gesture.pinch.in and browser.gesture.pinch.out for example cmd_fullZoomReduce-disable – Rudolf Olah Sep 30 '18 at 0:30
4

I found a browser plugin called Grab and Drag which adds this functionality to FireFox.

  • 1
    Do you mean this add-on? – Pablo Bianchi Jul 9 '17 at 19:41
  • @PabloBianchi Yep that's the one – Hack-R Jul 9 '17 at 20:21
  • 1
    Grab and Drag appears to be designed for touch-only or pen-only computers. If you'd still like to use the mouse to select text etc., it's rather too drastic a solution. The MOZ_USE_XINPUT2 works great, enabling kinetic scrolling, fling and drag-to-scroll. – Leif Arne Storset Oct 24 '17 at 8:33
  • @LeifArneStorset Seems to work for me, but I'll definitely check out the other solution as well, thanks – Hack-R Oct 24 '17 at 21:31
  • The add-on's page seems to be deleted =( – xjcl Apr 3 at 0:44
1

Install the "Drag to Scroll" plugin. https://addons.mozilla.org/en-US/firefox/addon/drag_scroll/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.