Page MenuHome

Fix T88386: Continuous Grab occasionally jumping on Arm64 MacOS
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Aug 12 2021, 4:34 AM.

Details

Summary

Fixes the bug by updating the method of recording the amount of time the system has been awake.


During the processing of a continuous drag event, other mouse move events may be in the queue waiting to be processed.

But when a mouse wrapping happens, these waiting mouse move events become out of date as they report a mouse position prior to wrapping.

The current code ignores these events by comparing their timestamp to the time recorded in the last mouse wrapping.

The bug happens because the computed value in mach_absolute_time() * 1e-9 for some reason is incompatible with the value of [event timestamp].

Since macOS 10.6, we have a new way to get the amount of time the system has been awake. [[NSProcessInfo processInfo] systemUptime]

Using this method of recording time the bug was finally fixed.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 16373
Build 16373: arc lint + arc unit

Event Timeline

Germano Cavalcante (mano-wii) requested review of this revision.Aug 12 2021, 4:34 AM
Germano Cavalcante (mano-wii) created this revision.
This revision is now accepted and ready to land.Aug 12 2021, 12:32 PM

My understanding is that the issue is that we should have used mach_timebase_info rather than hardcoding the factor to 1e-9, but systemUptime takes care of it automatically so is the simplest solution.