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!

0

6 Answers 6

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

10
  • 1
    thanks, this is the only that worked for me for firefox 70 Commented Oct 27, 2019 at 20:03
  • 2
    super! Thanks! I can confirm this works on Xubuntu 20.04 on a T460s Thinkpad.
    – Vlad
    Commented May 25, 2020 at 13:12
  • 2
    Thanks! I confirm this works on Ubuntu 20.04 on a T440 Thinkpad.
    – daparic
    Commented Aug 13, 2020 at 5:53
  • Thanks! Worked on Debian 11. Commented Jan 25, 2022 at 11:04
  • 1
    Worked for me on Ubuntu 22.04.1 & Firefox 103.0.2. Thanks!
    – Mapper
    Commented Aug 23, 2022 at 8:40
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.

8
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
1
  • 1
    Verified the pam_env.conf change works on Ubuntu 22.04 with default Firefox (snap). You would need to reboot the system after the changes for this to take effect.
    – x__x
    Commented Dec 28, 2022 at 15:01
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
2
  • 1
    Verified the pam_env.conf change works on Ubuntu 22.04 with default Firefox (snap). You would need to reboot the system after the changes for this to take effect.
    – x__x
    Commented Dec 28, 2022 at 15:01
  • +1 upvote answer and +1 upvote comment - In 2024, confirming this answer is working on Zorin OS Pro 16.3 with Firefox on a Panasonic FZ-G1 MkIII Toughpad touchscreen x86-64 tablet PC. Thank you very very very much! One finger stroke to scroll works, pinch to zoom works. Check out my posts on Zorin OS Forum to get this tablet working brilliantly, extending the useful life of it, since it won't officially run Windows 11: forum.zorin.com/u/therobyouknow/activity Thanks again! Commented Sep 3 at 20:37
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.

1
  • Verified the pam_env.conf change works on Ubuntu 22.04 with default Firefox (snap). You would need to reboot the system after the changes for this to take effect.
    – x__x
    Commented Dec 28, 2022 at 15:01
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
    Commented Sep 23, 2022 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
    Commented Sep 23, 2022 at 22:25
  • Can it be inside .bashrc?
    – Ziyuan
    Commented Oct 25, 2022 at 19:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .