[PATCH 0/3] Mouse cursor improvements on macOS and VNC

Phil Dennis-Jordan posted 3 patches 5 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240608202045.2815-1-phil@philjordan.eu
Maintainers: Peter Maydell <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Akihiko Odaki <akihiko.odaki@daynix.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>
hw/input/hid.c        |  12 +--
hw/usb/dev-wacom.c    |  11 +--
include/qemu/cutils.h |  11 +++
ui/cocoa.m            | 167 +++++++++++++++++++++++++++++++++++++++++-
ui/cursor.c           |   2 +-
ui/trace-events       |   7 ++
6 files changed, 185 insertions(+), 25 deletions(-)
[PATCH 0/3] Mouse cursor improvements on macOS and VNC
Posted by Phil Dennis-Jordan 5 months, 2 weeks ago
This series of loosely related changes provides some minor improvements
in mouse cursor usability.

 1. This one-liner changes alpha downsampling when using a UI frontend
    which does not support alpha-blended mouse cursors. Previously,
    any pixel with an alpha value other than 255 was treated as fully
    transparent in this context. This looks pretty bad when the guest
    OS uses anti-aliased cursors. (e.g. macOS) This occurs with some
    VNC clients, for example.
 2. This change has nothing to do with cursors: there are two
    functionally identical implementations of an int_clamp() inline
    function in the Qemu codebase. This unifies them in the shared
    cutils.h header, as I'm about to use it in a third location in
    patch number 3.
 3. This sizeable patch implements cursor support in the (macOS) Cocoa
    UI frontend. This fixes the issue of no mouse pointer showing up
    when using virtio-vga on a macOS host, for example.
    It unfortunately introduces some complexity to the mouse movement
    event handling when using a relative pointing device in the guest,
    as teleporting the cursor on the host offsets the next mouse event
    delta by a corresponding amount. We therefore need to track this
    offset and counteract it when processing the event. For details,
    see the commit message and inline comments.

This work was sponsored by Sauce Labs Inc.

Phil Dennis-Jordan (3):
  Cursor: 8 -> 1 bit alpha downsampling improvement
  hw: Moves int_clamp() implementations to header
  ui/cocoa: Adds support for mouse cursors

 hw/input/hid.c        |  12 +--
 hw/usb/dev-wacom.c    |  11 +--
 include/qemu/cutils.h |  11 +++
 ui/cocoa.m            | 167 +++++++++++++++++++++++++++++++++++++++++-
 ui/cursor.c           |   2 +-
 ui/trace-events       |   7 ++
 6 files changed, 185 insertions(+), 25 deletions(-)

-- 
2.36.1