Closed Bug 1901164 Opened 1 year ago Closed 1 year ago

Wrong mouse cursor after opening new windows or tabs

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 128
defect

Tracking

()

VERIFIED FIXED
128 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox127 --- unaffected
firefox128 --- verified

People

(Reporter: tgnff242, Assigned: gregp)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(2 files)

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

Steps to reproduce:

This is a bit tricky to reproduce.

  1. Open a link in a new tab or window.
  2. Before the page loads, already have the mouse over an element that should use the hand cursor, like a link in the page, and keep it there until the page fully loads.
  3. Move the mouse over the element it's already over.
  4. Move the mouse over other elements in the page.

Actual results:

It seems that at step 2, the mouse uses the arrow cursor instead of the hand. It's a bit intermittent, so this might require a few attempts to reproduce. The cursor stays like it for some time, even when hovering over other elements that should change the cursor, but eventually gets back to normal.

Expected results:

Bug 1858801 seems to be the regressor.

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=50d384723f07420b626d34e4f6db8417361b18e9&tochange=e8f156027b8630baf5944740a80ef83d3694f0ab

Has STR: --- → yes
Regressed by: 1858801

Are you able to record a video of the issue ?

Attached video cursor_arrow_hand.mp4

Here is a record of the screen.

This happens because we unlock the cursor by window.setCursor("auto"), which not only unlocks the cursor, but sets the cursor to eCursor_standard, regardless of whether a remote target is setting the cursor.
https://searchfox.org/mozilla-central/rev/d3fea1aa852bb3a353a0a4a875c3685da11ce39b/browser/base/content/browser.js#3512
https://searchfox.org/mozilla-central/rev/d3fea1aa852bb3a353a0a4a875c3685da11ce39b/dom/events/EventStateManager.cpp#4691,4711-4714

So, the easiest way to fix this is to just put resetting the cursor behind the pref. This isn't a full fix, because the issue will still be visible to those who enable this feature....but we're in soft freeze now and the correct way to fully fix this is to refactor a bunch of widget code, I think.

This will introduce a new issue where if you disable the pref while a page is loading, the cursor will stay spinning for the lifetime of the window. This is really hard to do accidentally, so its probably fine.

Assignee: nobody → gregp
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by gp3033@protonmail.com: https://hg.mozilla.org/integration/autoland/rev/31c715ecbd79 Don't set the cursor to auto if browser.spin_cursor_while_busy=false r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
Severity: -- → S3

Reproduced the initial issue using an old Nightly build from 2024-06-06 on Ubuntu 22.04. Verified that using latest Nightly 129.0a1 and latest Beta version 128.0b9 the cursor correctly changes to a hand icon when placed on an element with a link and back to an arrow when not.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: