Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-08-12 05:28:34 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-11-02 12:58:14 +0300
commit6489f2212b96fc7d2ab5abd23e487dd76e7b7c07 (patch)
tree7af3f7821178fa845dbe2a2d3c04e97058e38487 /intern
parent379ffa75aa0cf80ece0b831fdf6b3d2994743740 (diff)
Fix T88386: Continuous Grab occasionally jumping on Arm64 MacOS
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 updated method fixed the problem. Differential Revision: https://developer.blender.org/D12202
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 050c90097c5..31ce5649fdf 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1628,7 +1628,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
y_accum + (y_mouse - warped_y_mouse));
/* This is the current time that matches NSEvent timestamp. */
- m_last_warp_timestamp = mach_absolute_time() * 1e-9;
+ m_last_warp_timestamp = [[NSProcessInfo processInfo] systemUptime];
}
// Generate event