[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 20/26] hw/display/apple-gfx: Fixes cursor hotspot handling
From: |
Phil Dennis-Jordan |
Subject: |
[PATCH 20/26] hw/display/apple-gfx: Fixes cursor hotspot handling |
Date: |
Mon, 15 Jul 2024 23:06:59 +0200 |
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 <phil@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)
- [PATCH 08/26] hw/display/apple-gfx: Adds migration blocker, (continued)
- [PATCH 08/26] hw/display/apple-gfx: Adds migration blocker, Phil Dennis-Jordan, 2024/07/17
- [PATCH 24/26] hw/display/apple-gfx: Adds configurable mode list, Phil Dennis-Jordan, 2024/07/17
- [PATCH 25/26] MAINTAINERS: Add myself as maintainer for apple-gfx, reviewer for HVF, Phil Dennis-Jordan, 2024/07/17
- [PATCH 21/26] hw/display/apple-gfx: Implements texture syncing for non-UMA GPUs, Phil Dennis-Jordan, 2024/07/17
- [PATCH 04/26] hw/display/apple-gfx: uses DEFINE_TYPES macro, Phil Dennis-Jordan, 2024/07/17
- [PATCH 23/26] hw/display/apple-gfx: Host GPU picking improvements, Phil Dennis-Jordan, 2024/07/17
- [PATCH 01/26] hw/vmapple/apple-gfx: Introduce ParavirtualizedGraphics.Framework support, Phil Dennis-Jordan, 2024/07/17
- [PATCH 02/26] hw/vmapple/apple-gfx: BQL renaming update, Phil Dennis-Jordan, 2024/07/17
- [PATCH 05/26] hw/display/apple-gfx: native -> little endian memory ops, Phil Dennis-Jordan, 2024/07/17
- [PATCH 07/26] hw/display/apple-gfx: Makes set_mode thread & memory safe, Phil Dennis-Jordan, 2024/07/17
- [PATCH 20/26] hw/display/apple-gfx: Fixes cursor hotspot handling,
Phil Dennis-Jordan <=
- [PATCH 06/26] hw/display/apple-gfx: Removes dead/superfluous code, Phil Dennis-Jordan, 2024/07/17
- [PATCH 17/26] hw/display/apple-gfx: Asynchronous rendering and graphics update, Phil Dennis-Jordan, 2024/07/17
- [PATCH 13/26] hw/display/apple-gfx: Defines PGTask_s struct instead of casting, Phil Dennis-Jordan, 2024/07/17
- [PATCH 16/26] hw/display/apple-gfx: Asynchronous MMIO writes on x86-64, Phil Dennis-Jordan, 2024/07/17
[PATCH 11/26] hw/display/apple-gfx: Uses ObjC category extension for private property, Phil Dennis-Jordan, 2024/07/17
[PATCH 15/26] hw/display/apple-gfx: Separates generic & vmapple-specific functionality, Phil Dennis-Jordan, 2024/07/17