27

Using Firefox quantum 57 and Ubuntu 17.10, I am unable to scroll a web page by touching the screen and sliding the page. However this works in Chrome browser.

How to make touch-screen scrolling work in Firefox Quantum?

Enterprise
  • 12,352

1 Answers1

37

The same solution for Firefox 50 and Ubuntu 16.xx still works for Firefox Quantum 57 and Ubuntu 17.10: Ubuntu 16 and touchscreen scrolling in FireFox

The solution is to launch firefox using:

env MOZ_USE_XINPUT2=1 firefox

You can make this permanent by modifying the launcher using the following:

sudo sed -i "s|Exec=|Exec=env MOZ_USE_XINPUT2=1 |g" /usr/share/applications/firefox.desktop

To undo this change, use:

sudo sed -i "s|Exec=env MOZ_USE_XINPUT2=1 |Exec=|g" /usr/share/applications/firefox.desktop

EDIT: Per @poomerang's comment below, if you are using the Snap version of Firefox, the path in the above commands should be /var/lib/snapd/desktop/applications/firefox_firefox.desktop

Comparing touch scrolling in Firefox Quantum, using this solution. with touch scrolling in Chrome:

  • Scrolling is one finger only; two finger scrolling causes the web page to zoom. This is different from Chrome, where you can scroll using two fingers, but still pinch to zoom or un-zoom.
  • You can only scroll vertically or horizontally, depending on which direction your initial motion is in; this is different from Chrome, where you can scroll horizontally or vertically (or in circles) without lifting your finger(s).
Enterprise
  • 12,352
  • YOU ARE A GOD PJ!!! I've been searching for how to do that for 2 months now and using half baked extensions for touch dragging that really didn't work that well. Funny thing is that I came across this answer while searching for something completely different... Thanks! – thebunnyrules Jan 22 '18 at 22:45
  • After a bit of testing, it seems to be too unstable to be usable, probably why it's still off by default. It works great at first but as soon as you long click to select text, it makes a context menu popup and things turn really buggy after that. Ah well. Probably a work in progress. – thebunnyrules Jan 22 '18 at 23:25
  • @thebunnyrules I think I'm having the same problem as you, check out https://bugzilla.mozilla.org/show_bug.cgi?id=1451587 if you have the chance. – blendmaster Apr 05 '18 at 01:12
  • @blendmaster When I use FF wayland, the instability goes away. The popup menu still clashes with caret but a double tap can be used instead of a long press to call it. For X11, I just disabled long press for context menu as a temp solution. I can tell you how to do so if you know how to compile ff. – thebunnyrules Apr 09 '18 at 23:43
  • Thanks for the details @thebunnyrules . If you can post the patch somewhere for disabling long press that'd be helpful. Might be able to add debugging info for the issue as well. – blendmaster Apr 14 '18 at 18:56
  • Sorry for the delay. I can give you some detailed instructions but I wouldn't want to upload the whole file because these files tend to get updated and changed and you don't want to overwrite those updates just for my one line patch. – thebunnyrules Apr 22 '18 at 03:17
  • 1
    Ok so, when you extract the source, find: /gfx/thebes/gfxPrefs.h . Open that file and look for ui.click_hold_context_menus.delay ( the full line is DECL_GFX_PREF(Live, "ui.click_hold_context_menus.delay", UiClickHoldContextMenusDelay, int32_t, 500); ) You want to change that 500 at the very end to 9999 (that's 500ms of delay to 10 second). That's it. You won't have a context menu anymore but at least touch will be stable in X11. Once you get touch working, I'd really recommend the Tablet Gestures addon, it puts ff on parity with chrome for touch at that point. – thebunnyrules Apr 22 '18 at 03:28
  • @blendmaster I put a more complete post on the thread you mentioned. Good luck! – thebunnyrules Apr 22 '18 at 04:25
  • 1
    This still works for Ubuntu 22.04, BUT: the file to modify is no longer /usr/share/applications/firefox.desktop (doesn't do anything), but /var/lib/snapd/desktop/applications/firefox_firefox.desktop . Apparently – poomerang Dec 26 '22 at 11:54
  • Is adding export MOZ_USE_XINPUT2=1 to ~/.profile a good idea? It seems to work for me but I was wondering why no one proposed it – leleogere Jul 10 '23 at 07:10