The ParavirtualizedGraphics framework provides the cursor's
hotspot, this change actually passes that information through to
Qemu's cursor handling.

This change also seizes the opportunity to make other cursor
related code conform to coding standards.

Signed-off-by: Phil Dennis-Jordan <p...@philjordan.eu>
---
 hw/display/apple-gfx.m | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m
index 437294d0fb..bc9722b420 100644
--- a/hw/display/apple-gfx.m
+++ b/hw/display/apple-gfx.m
@@ -223,7 +223,8 @@ static void apple_gfx_fb_update_display(void *opaque)
 
 static void update_cursor(AppleGFXState *s)
 {
-    dpy_mouse_set(s->con, s->pgdisp.cursorPosition.x, 
s->pgdisp.cursorPosition.y, s->cursor_show);
+    dpy_mouse_set(s->con, s->pgdisp.cursorPosition.x,
+                  s->pgdisp.cursorPosition.y, s->cursor_show);
 
     /* Need to render manually if cursor is not natively supported */
     if (!dpy_cursor_define_supported(s->con)) {
@@ -423,7 +424,8 @@ static void 
apple_gfx_register_task_mapping_handlers(AppleGFXState *s,
         trace_apple_gfx_mode_change(sizeInPixels.x, sizeInPixels.y);
         set_mode(s, sizeInPixels.x, sizeInPixels.y);
     };
-    disp_desc.cursorGlyphHandler = ^(NSBitmapImageRep *glyph, PGDisplayCoord_t 
hotSpot) {
+    disp_desc.cursorGlyphHandler = ^(NSBitmapImageRep *glyph,
+                                     PGDisplayCoord_t hotSpot) {
         uint32_t bpp = glyph.bitsPerPixel;
         uint64_t width = glyph.pixelsWide;
         uint64_t height = glyph.pixelsHigh;
@@ -434,6 +436,8 @@ static void 
apple_gfx_register_task_mapping_handlers(AppleGFXState *s,
             cursor_unref(s->cursor);
         }
         s->cursor = cursor_alloc(width, height);
+        s->cursor->hot_x = hotSpot.x;
+        s->cursor->hot_y = hotSpot.y;
 
         /* TODO handle different bpp */
         if (bpp == 32) {
-- 
2.39.3 (Apple Git-146)


Reply via email to