30

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!

0

6 Answers 6

31

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.

6
29
  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

8
  • 1
    thanks, this is the only that worked for me for firefox 70 Oct 27, 2019 at 20:03
  • 2
    super! Thanks! I can confirm this works on Xubuntu 20.04 on a T460s Thinkpad.
    – Vlad
    May 25, 2020 at 13:12
  • 2
    Thanks! I confirm this works on Ubuntu 20.04 on a T440 Thinkpad. Aug 13, 2020 at 5:53
  • Thanks! Worked on Debian 11. Jan 25 at 11:04
  • Thanks! Worked on Ubuntu Mate 20.04.4 LTS Focal Fossa for GPD Pocket 2
    – Brian
    Mar 24 at 22:56
2

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
1

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
0

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.

0

Open up terminal and paste this command

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

3
  • An explanation will be welcome.
    – Toto
    Sep 23 at 19:01
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Sep 23 at 22:25
  • Can it be inside .bashrc?
    – Ziyuan
    Oct 25 at 19:00

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.