qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: Phil Dennis-Jordan <phil@philjordan.eu>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, philmd@linaro.org, marcandre.lureau@redhat.com
Subject: Re: [PATCH 3/3] ui/cocoa: Adds support for mouse cursors
Date: Sun, 9 Jun 2024 18:06:24 +0900	[thread overview]
Message-ID: <dd047370-f0ed-4b8c-a251-037e82f64986@daynix.com> (raw)
In-Reply-To: <20240608202045.2815-4-phil@philjordan.eu>

On 2024/06/09 5:20, Phil Dennis-Jordan wrote:
> This change implements the callbacks dpy_cursor_define and dpy_mouse_set
> for the Cocoa UI. The incoming mouse cursor image is converted into an
> NSCursor object, allowing the guest mouse cursor to be rendered as the
> host's native OS cursor on macOS.
> 
> This is straightforward in absolute pointing mode, but rather trickier
> with a relative pointing device:
> 
>   1. The cursor position in Qemu's coordinate system must be translated
>      and converted into macOS's Core Graphics/Quartz coordinates when
>      positioning the cursor. Additionally, the position already includes
>      the hotspot offset; we'd prefer to use the host OS's hotspot support
>      so we need subtract the hotspot vector off again.
>   2. Setting the cursor position programmatically on macOS biases the
>      next mouse movement event by the amount the cursor was shifted.
>      If we didn't reverse that bias when forwarding the next event
>      back into Qemu's input stack, this would create a feedback loop.
>      (The behaviour of affecting mouse events makes sense for e.g.
>      setting the cursor position in a remote access system.)
> 
> This change slightly improves the user experience when using virtual
> display adapter implementations which check for UI back-end cursor
> support, and fixes the issue of no visible mouse cursor when using one
> which does not. (Such as virtio-vga)

Thanks for working on ui/cocoa, but I already have submitted a patch for 
this particular problem:
https://patchew.org/QEMU/20240318-cursor-v1-0-0bbe6c382217@daynix.com/

The difference between these patches is that my patch does not use 
warping at all. I thought reversing the mouse movement bias is a fragile 
approach that depends on the details of how Quartz works.


  reply	other threads:[~2024-06-09  9:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-08 20:20 [PATCH 0/3] Mouse cursor improvements on macOS and VNC Phil Dennis-Jordan
2024-06-08 20:20 ` [PATCH 1/3] Cursor: 8 -> 1 bit alpha downsampling improvement Phil Dennis-Jordan
2024-06-09  8:52   ` Akihiko Odaki
2024-06-08 20:20 ` [PATCH 2/3] hw: Moves int_clamp() implementations to header Phil Dennis-Jordan
2024-06-09  8:59   ` Akihiko Odaki
2024-06-10  8:50     ` Phil Dennis-Jordan
2024-06-10  8:54       ` Akihiko Odaki
2024-06-08 20:20 ` [PATCH 3/3] ui/cocoa: Adds support for mouse cursors Phil Dennis-Jordan
2024-06-09  9:06   ` Akihiko Odaki [this message]
2024-06-10 14:00     ` Phil Dennis-Jordan
2024-06-11  7:35       ` Akihiko Odaki
2024-06-25 18:57         ` Phil Dennis-Jordan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd047370-f0ed-4b8c-a251-037e82f64986@daynix.com \
    --to=akihiko.odaki@daynix.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=phil@philjordan.eu \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).