qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ui/cocoa: Adds native absolute pointer support
@ 2024-06-25 13:49 Phil Dennis-Jordan
  2024-06-25 13:49 ` [PATCH v2 1/2] ui/cocoa: Minor fixes to CALayer based cursors Phil Dennis-Jordan
  2024-06-25 13:49 ` [PATCH v2 2/2] ui/cocoa: Adds NSCursor absolute pointer support Phil Dennis-Jordan
  0 siblings, 2 replies; 4+ messages in thread
From: Phil Dennis-Jordan @ 2024-06-25 13:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, philmd, marcandre.lureau, akihiko.odaki, lists,
	Phil Dennis-Jordan

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)



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-27 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-25 13:49 [PATCH v2 0/2] ui/cocoa: Adds native absolute pointer support Phil Dennis-Jordan
2024-06-25 13:49 ` [PATCH v2 1/2] ui/cocoa: Minor fixes to CALayer based cursors Phil Dennis-Jordan
2024-06-25 13:49 ` [PATCH v2 2/2] ui/cocoa: Adds NSCursor absolute pointer support Phil Dennis-Jordan
2024-06-27 11:48   ` Akihiko Odaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).