Closed Bug 1695466 Opened 4 years ago Closed 4 years ago

Scrollbar flickering on wayland

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 86
defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: tom, Assigned: tom)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Attached video Recording.mkv (deleted) —

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

Steps to reproduce:

  • Start Firefox with Wayland enabled. (MOZ_ENABLE_WAYLAND=1)
  • Open a page that shows a vertical scrollbar.
  • Position the mouse over the scrollbar, at the rightmost pixel of the screen.
  • Move the mouse further to the right, keeping the cursor over the scrollbar.

Actual results:

The scrollbar flickers, so that clicking the mouse sometimes fails to "grab" the scrollbar. (See the behavior in the attached video)

Expected results:

The scrollbar should remain clickable as long as the cursor is positioned over it.

Observed with the arch linux firefox 86.0 package, and nightly 88.0a1
Reproducible on different compositors, including sway/wlroots and weston.

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

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

I'm unable to reproduce on Gnome/Mutter/Fedora 33.

Blocks: wayland-sway
Priority: -- → P3

I can reproduce this on fedora 33, gnome & mutter 3.38.3, firefox 85.0.1, by having firefox in full-screen and moving the cursor on this very page to the right edge of the screen, at the limit of the scrollbar. I see the same flickering as in the video while the cursor is moving along the edge, and it stops with a random "hover or not" state when I stop moving the cursor.

(I originally came here because I thought someone finally reported the flickering corruption (stride issue I think) I'm seeing on the firefox scrollbar on sway, but that's not it... I need to catch it in the act and report it ^^)

I believe I've found the issue. When using GDK_BACKEND=x11, the coordinates in the GdkEventMotion callback will be floored floating-point values, but with wayland, the coordinates may be fractional. When the coordinates are converted to device pixels, they are rounded. As a result, the coordinates of the WidgetMouseEvent are occasionally 1 pixel greater than the actual cursor position.

This also results in some other visual glitches with very small mouse movements, as you can see in the new attached recording.

Attached video Recording2.mp4 (deleted) —
Assignee: nobody → tom
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/3baeabb258d4 Fix rounding in GdkEventCoordsToDevicePixels r=stransky
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: