This change implements passing guest cursors through to the native Cocoa host NSCursor on macOS when using absolute pointing device input.
The first pass at this was based purely on NSCursor, which drew some criticism due to the somewhat complex nature of the code which was required to generate correct relative pointer input events after teleporting the host cursor. This new version builds on Akihiko Odaki's work implementing CALayer based cursors. We retain CALayer for compositing cursors when the input is relative and the pointer thus completely captured by the guest. When using absolute positioning of the pointer, we use the fully host-integrated NSCursor, with no offsetting or teleporting needed. The first patch consists of a few reference counting fixes to the existing CALayer patch, the second implements the NSCursor logic and switches between CALayer and NSCursor depending on whether relative or absolute input is used. Based-on: <20240318-cursor-v1-2-0bbe6c382...@daynix.com> Phil Dennis-Jordan (2): ui/cocoa: Minor fixes to CALayer based cursors ui/cocoa: Adds NSCursor absolute pointer support ui/cocoa.m | 93 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 18 deletions(-) -- 2.39.3 (Apple Git-146)