Closed Bug 2012124 Opened 5 months ago Closed 2 months ago

pointermove movementY is always zero in requestPointerLock mode

Categories

(Core :: DOM: Events, defect, P3)

Firefox 146
defect

Tracking

()

RESOLVED DUPLICATE of bug 2036028

People

(Reporter: caiiiycuk, Assigned: edgar)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached video ffbug.mp4

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

Steps to reproduce:

  1. I am able to reproduce it with this:
target.addEventListener("pointerdown", (e) => target.requestPointerLock({ unadjustedMovement: true }));
target.addEventListener("pointermove", (e) => {
    console.log(e.movementX, e.movementY);
});

Slowly move mouse up

  1. Or this testcase from here (https://bugzilla.mozilla.org/show_bug.cgi?id=1895796)

Open https://codepen.io/gensee/full/zYQOXLK, lock mouse and move it

Actual results:

  1. The output is 90% zero (i am moving constantly), and sometimes there are +1 -1, cumulative value is zero. This prevents me to play games on different websites using FF.

  2. My Y coordinates changes is zero (chrome works fine look at the video).

Expected results:

  1. I should see sequences of +1 or -1.

  2. y should change

Distributor ID: Ubuntu
Description: Ubuntu 25.10
Release: 25.10
plasmashell 6.4.5
wayland

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

Component: Untriaged → DOM: Events
Product: Firefox → Core

masayuki, you looked at some movementX/Y stuff recently. Does this bug ring any bells?

Severity: -- → S3
Flags: needinfo?(masayuki)
Priority: -- → P3

(Today, I was PTO-ish due to a private matter so that I've not investigated this yet.)

I didn't change the logic at least intentionally. So, I have no idea and I'm not familiar with Pointer Lock implementation.

Edgar, how about you?

Flags: needinfo?(echen)

I will take a look.

Flags: needinfo?(masayuki)

I can reproduce this on Wayland and only happens on OOP iframe. If the pointerlock request is on the top-level document, I can not reproduce the issue, e.g. https://mdn.github.io/dom-examples/pointer-lock/. I think this is Wayland specific issue. And I guess this is something related to https://searchfox.org/firefox-main/rev/eea0f8f080f0eb810c0c6296da9792e81cd69ce6/widget/gtk/nsWindow.cpp#9633-9635. Taking this to see now.

Assignee: nobody → echen
Flags: needinfo?(echen)

I believe bug 2036028 also fixes this. Feel free to reopen or file a new bug if you still encounter same issue.

Status: UNCONFIRMED → RESOLVED
Closed: 2 months ago
Duplicate of bug: 2036028
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: