Closed Bug 1836886 Opened 1 year ago Closed 18 days ago

[wl_pointer.axis_value120] Firefox does not support high resolution scrollwheels in Wayland mode

Categories

(Core :: Widget: Gtk, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: kode54, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0

Steps to reproduce:

  1. Install Firefox Nightly.
  2. Run it with MOZ_USE_XINPUT2=1 set and GDK_CORE_DEVICE_EVENTS unset.
  3. Browser runs in Wayland mode.

Actual results:

My MX Master 3 is locked to large wheel steps, under GNOME, Plasma, and wlroots compositors.

Expected results:

My mouse's reported high precision scrolling events should trigger fine scrolling in the browser.

This problem does not occur if I force it to run under Xwayland and enable the xinput2 mode.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Does this happen with other GTK applications?

Seems to be implemented in wayland 1.21 by wl_pointer.axis_value120 interface (https://lists.freedesktop.org/archives/wayland-devel/2022-May/042194.html). It should be implemented by somehow who owns such hardware.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

Does this happen with other GTK applications?

I guess it's Gtk4 only.

Summary: Firefox does not support high resolution scrollwheels in Wayland mode → [wl_pointer.axis_value120] Firefox does not support high resolution scrollwheels in Wayland mode

+1 for this bug. Running Fedora 39 using the Wayland session. On x11, firefox notices the high resolution scroll events and behaves as expected. Using Wayland, firefox only scrolls on the low resolution event. Trackpad scrolling is smooth as expected on both. Aside from firefox, only gtk3 apps do not use the high resolution scroll, everything works on gtk4, chrome (wayland and x11), electron...

To reproduce this bug without the required hardware, you could possibly use libinput-config (https://gitlab.com/warningnonpotablewater/libinput-config) and set discrete-scroll-factor-y=0.125

(In reply to Martin Stránský [:stransky] (ni? me) from comment #4)

Seems to be implemented in wayland 1.21 by wl_pointer.axis_value120 interface (https://lists.freedesktop.org/archives/wayland-devel/2022-May/042194.html). It should be implemented by somehow who owns such hardware.

I own relevant hardware and am in need of this feature; do you have any pointers (for someone familiar with the concepts, but unfamiliar with the codebase) where to start implementing?

This may be related:
https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/652

I'm not sure how it's integrated with Gtk3 (Firefox uses Gtk3 toolkit to get mouse events).

Looks like it was merged to Gtk4 only. We'd need Gtk3 packport for it.
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3839

Duplicate of this bug: 1902839
Depends on: gtk4

I want to correct one observation. As I observed in bug 1902839:

Page scrolls once per 7~8 EV_REL / REL_WHEEL_HI_RES events by same amount as with mouse with normal wheel. When scrolling slowly, one hires event is 16° in my case. FF scrolling is not synchronous to EV_REL / REL_WHEEL (non high resolution) events, so it looks like input stack is processing hires events, but it somehow pre-scales them and then scrolls in coarser steps.

Impact of this fact is quite annoying. When I focus FF and scroll wheel is not aligned, then enable ratcheting on the mouse, not every "click" of the wheel produces 1 step of page scroll. Some wheel "clicks" result in none and other in 2 scroll steps in FF.

I will attach libinput recording file, yo you can replay it on your systems.

libinput record output for Logitech master 3S scrolling:

  • scroll down
  • scroll up
  • scroll down,
  • repeated very short scrolls up/down
See Also: → 1568722
Duplicate of this bug: 1909596
Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
See Also: → 1749169

Botond, for the smooth/hi-res scroll we use right now:

  WidgetWheelEvent wheelEvent(true, eWheel, this);
  wheelEvent.mDeltaMode = dom::WheelEvent_Binding::DOM_DELTA_LINE;
  wheelEvent.mDeltaX = aDeltaX * 3;
  wheelEvent.mDeltaY = aDeltaY * 3;
  wheelEvent.mWheelTicksX = aDeltaX;
  wheelEvent.mWheelTicksY = aDeltaY;
  wheelEvent.mIsNoLineOrPageDelta = true;

I wonder if there's any other settings we may use, close to touch scroll perhaps?
Thanks.

Flags: needinfo?(botond)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/5dfed78115dc [Wayland] Implement smooth scrolling r=emilio

Updated, Thanks.

Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/ae042b115f6f [Wayland] Implement smooth scrolling r=emilio
Status: ASSIGNED → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
Regressions: 1922916

(In reply to Martin Stránský [:stransky] (ni? me) from comment #15)

Botond, for the smooth/hi-res scroll we use right now:

  WidgetWheelEvent wheelEvent(true, eWheel, this);
  wheelEvent.mDeltaMode = dom::WheelEvent_Binding::DOM_DELTA_LINE;
  wheelEvent.mDeltaX = aDeltaX * 3;
  wheelEvent.mDeltaY = aDeltaY * 3;
  wheelEvent.mWheelTicksX = aDeltaX;
  wheelEvent.mWheelTicksY = aDeltaY;
  wheelEvent.mIsNoLineOrPageDelta = true;

I wonder if there's any other settings we may use, close to touch scroll perhaps?

Apologies for the delay.

I assume you mean touchpad rather than touchscreen, since touchpad seems like the closer analogue to hi-res mousewheel (for touchscreen, the logic is a more simple "the page moves as much as your finger did").

The only thing that comes to mind is perhaps using the method of computing deltas for a touchpad here (with the delta type being set to DOM_DELTA_PIXEL or DOM_DELTA_PAGE depending on isPageMode).

I don't have a good sense of how much of an improvement that would be in practice.

Flags: needinfo?(botond)
Regressions: 1923875
Blocks: 1568722
See Also: 1568722
No longer depends on: gtk4
See Also: → gtk4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: