39

In Firefox, swiping on the touch screen results in selecting text, instead of scrolling (like on an iPad). Is it possible to change the behaviour, so that the touch screen can be used to scroll, while the mouse can be used to select text?

In Chrome, the behaviour is as expected (swipe to scroll, (mouse)drag to select).

I'm using Firefox 50.0 on Linux Mint 18 (based on Ubuntu 16.04). I have dom.w3c_touch_events.enabled set to 2, setting it to 1 does not help either.

Thanks for any help!

Matthijs Melissen
  • 867
  • 1
  • 7
  • 7

6 Answers6

43
  1. Edit /etc/security/pam_env.conf and add this line:

     MOZ_USE_XINPUT2 DEFAULT=1
    
  2. Log out and in again

see https://askubuntu.com/a/994483/34298

rubo77
  • 5,218
36

I finally found a solution: start firefox with:

env MOZ_USE_XINPUT2=1 firefox

This enables touch-scrolling for me. Pinch-to-zoom does not work for regular web pages, but it does work on some selected web pages such as Google Maps or OpenStreetMap.

jsve
  • 269
  • 2
  • 12
Matthijs Melissen
  • 867
  • 1
  • 7
  • 7
6

Firefox supports touchscreen properly when running in wayland mode, however currently that must be enabled manually.

You can check if you are running firefox in wayland mode or xwayland mode by going to about:support and scrolling to "Window Protocol"

If you are in xwayland mode, you can tell firefox to use wayland mode instead by setting MOZ_ENABLE_WAYLAND=1 in your environment variables.

If firefox is installed as a flatpak, run this (you might need root if installed system-wide):

flatpak override --env=MOZ_ENABLE_WAYLAND=1 org.mozilla.firefox

Otherwise if firefox is installed through repo packages, you should add the following line to /etc/security/pam_env.conf:

MOZ_ENABLE_WAYLAND DEFAULT=0 OVERRIDE=1
5

Just updating with the new format in /etc/security/pam_env.conf --now variables must be defined with a default value (which can be empty, "") and an override value (which can be empty, "").

Add the environmental variable like this:

MOZ_USE_XINPUT2 DEFAULT=0       OVERRIDE=1
Toto
  • 19,304
1

With the latest Firefox 84.0.2 it works for scrolling without the risk of getting zoom while scrolling for both vertical and horizontal movements. Zoom works well on most pages with finger/thumb pinch/expand including Google Maps. Select is now activated, as on a mobile, by touch for a second or so then using the select markers. Touch and hold the selection to get the context menu for copy and cut/paste if text is editable. Better functionality than Chrome where the select markers cannot be adjusted from a single word selection!

My screen was detected as a "Wacom 5113 finger" under KDE Plasma 5.2 Manjaro/Arch Linux. I set KDE Wacom touch control panel "gestures off" otherwise weird things start happening on scroll.

Simply edit /etc/security/pam_env.conf and add MOZ_USE_XINPUT2 DEFAULT=1 then reboot.

The only loss seems to be drag items do not drag with finger input but will still work by mouse/touchpad.

CxOrg
  • 11
  • 2
0

Open up terminal and paste this command

echo export MOZ_USE_XINPUT2=1 | sudo tee /etc/profile.d/use-xinput2.sh

Mike
  • 1