[PATCH v2 0/2] ui/cocoa: Adds native absolute pointer support

Phil Dennis-Jordan posted 2 patches 5 months ago
Failed in applying to current master (apply log)
ui/cocoa.m | 93 +++++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 75 insertions(+), 18 deletions(-)
[PATCH v2 0/2] ui/cocoa: Adds native absolute pointer support
Posted by Phil Dennis-Jordan 5 months ago
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-0bbe6c382217@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)