Ship with MOZ_USE_XINPUT2=1 set in the environment to improve Firefox touchpad & touchscreen scrolling
Closed, ResolvedPublic

Description

On X11, with MOZ_USE_XINPUT2=1 set in the environment Firefox exhibits much improved pixel-by-pixel touchpad scrolling, and touchscreen scrolling actually works. On Wayland, the behavior is already enabled by default so the environment variable has no effect.

Historically, the reason why this was not set by default on X11 was an outstanding bug that caused scrolling with wheel mice to periodically break: https://bugzilla.mozilla.org/show_bug.cgi?id=1182700

However this bug appears to only affect KDE Plasma systems, and the KWin developers just fixed an issue in KWin, and now the problem no longer manifests. See https://bugs.kde.org/show_bug.cgi?id=394772.

Therefore, there no longer appear to be any blockers to enabling this behavior by default by setting MOZ_USE_XINPUT2=1 in the environment. X11 Firefox users should really appreciate this change.

  • wait for 5.19.3
  • throw /etc/xdg/plasma-workspace/env/moz_xinput.sh at neon-settings
ngraham created this task.Jun 24 2020, 2:49 PM
sitter added a subscriber: sitter.Jun 24 2020, 3:35 PM

Eeeeh, I actually wanna get away from injecting env vars into firefox with firefox 78. Surely the right approach would be for firefox to check what WM it runs under and then conditionally enable this magic?

The right approach would be for the GTK developers to accept Vlad's patch to fix it for everyone, but of course nothing's easy with those people. :(

Given that Neon is a KDE-focused environment, I don't think there's a huge risk of people not using KWin.

It's not about the risk, it's the fact that injecting env vars into firefox is a fragile hack. I mean, it's always a hack, it just happens to be particularly fragile the way it is currently done because we only force portals on firefox. Perhaps we could set it globally, but are we sure this doesn't mess with thunderbird?

Actually, about setting it globally, does it not cause adverse side effects when used with wayland? See, it's a right worry :(

It's not about the risk, it's the fact that injecting env vars into firefox is a fragile hack. I mean, it's always a hack, it just happens to be particularly fragile the way it is currently done because we only force portals on firefox. Perhaps we could set it globally, but are we sure this doesn't mess with thunderbird?

Yes, setting it globally was my idea, and that's what I run with on my system. I can confirm that it plays nice with Thunderbird and does not cause any regressions on Wayland. In fact I'm pretty sure it's a no-op on Wayland since xinput2 is used by default there for Firefox anyway.

Given that Neon is a KDE-focused environment, I don't think there's a huge risk of people not using KWin.

Your assumption is good, but I still think that this is dangerous var should be applied only under KWin, since people may still install Gnome or other DEs/WMs on Neon. Me, for example is actually doing this.

Out of curiosity, why would you do that? What's the advantage of Neon over a different distro if you're not going to use a different DE or window manager?

Users are free to do that because Neon has Ubuntu archives enable, which has a lot of desktops available, so there's non-zero probability of breaking Firefox for those people that like evaluating different DEs and switch between them some times. Advantage of Neon in this case will be to have latest KDE. One may also enable Mint archives and get the latest Cinnamon and MATE as well. Enable some ppa or some repo and you get the latest packages for different DE.

Sure, anything's possible. :) My point was that Neon is explicitly a KDE-centric distro. Breakage in non-KDE software is expected and normal; it's not supported at all. If there's a viable way to enable this only when using KWin, that would be idea. If not, I personally still think it's worth doing anyway to improve the experience for neon's target audience of KDE Plasma users.

I feel like we've had env exporting somewhere in startplasma

sitter updated the task description. (Show Details)Jul 1 2020, 2:00 PM
ngraham closed this task as Resolved.Sep 17 2020, 9:32 PM
ngraham claimed this task.

Looks like this got done.