Closed Bug 1404896 Opened 7 years ago Closed 7 years ago

Separate the pointer lock implementations from GenerateMouseEnterExit to new functions.

Categories

(Core :: DOM: Events, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: stone, Assigned: stone)

References

Details

Attachments

(1 file, 1 obsolete file)

Separate this from bug 1400143

It's not necessary to bundle the following logic to GenerateMouseEnterExit
1. update the ESM::sLastRefPoint
2. update event's mLastRefPoint
3. synthesize mouse move to bring the pointer to the center of window

And this can make it easier to reuse them for handling pointer events.
Assignee: nobody → sshih
Blocks: 1400143
Comment on attachment 8914323 [details] [diff] [review]
Separate the pointer lock implementations from GenerateMouseEnterExit to new functions.

Could you help me to review if the methods names make sense to you? Thanks.
Attachment #8914323 - Flags: review?(bugs)
Comment on attachment 8914323 [details] [diff] [review]
Separate the pointer lock implementations from GenerateMouseEnterExit to new functions.

>+  /**
>+   * Update the attribute mLastRefPoint of the mouse event. It should be
>+   *     the center of the window while the pointer is locked.
>+   *     the same value as mRefPoint while there is no last known mRefPoint.
"last known mRefPoint" doesn't really mean anything. But no known last ref point or so.

>+   *     the same value as the last known mRefPoint.
>+   */
>+  static void UpdateLastRefPointOfMouseEvent(WidgetMouseEvent* aMouseEvent);
>+
>+  static void ResetPointerToWindowCenterWhilePointerLocked(
>+                WidgetMouseEvent* aMouseEvent);
>+
>+  // Update the last known mRefPoint with the current mRefPoint.
I don't understand this comment. The method doesn't update any mRefPoint.
It updates the last known ref point with the current mRefPoint.
Attachment #8914323 - Flags: review?(bugs) → review+
Pushed by sshih@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0bb7fc4b9991
Separate the pointer lock implementations from GenerateMouseEnterExit to new functions. r=smaug.
https://hg.mozilla.org/mozilla-central/rev/0bb7fc4b9991
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: