[all] update KVMFR to provide cursor hotspot information

This commit bumps the KVMFR protocol version as it adds additional
hotspot x & y fields to the KVMFRCursor struct. This corrects the issue
of invalid alignment of the local mouse when the shape has an offset
such as the 'I' beam.
This commit is contained in:
Geoffrey McRae
2020-08-20 13:46:18 +10:00
parent 10fbdeb294
commit 7e362050f7
9 changed files with 45 additions and 13 deletions

View File

@@ -827,7 +827,26 @@ static CaptureResult dxgi_capture()
return CAPTURE_RESULT_ERROR;
}
CURSORINFO ci = { .cbSize = sizeof(CURSORINFO) };
if (!GetCursorInfo(&ci))
{
DEBUG_ERROR("GetCursorInfo failed");
return CAPTURE_RESULT_ERROR;
}
ICONINFO ii;
if (!GetIconInfo(ci.hCursor, &ii))
{
DEBUG_ERROR("GetIconInfo failed");
return CAPTURE_RESULT_ERROR;
}
DeleteObject(ii.hbmMask);
DeleteObject(ii.hbmColor);
pointer.shapeUpdate = true;
pointer.hx = ii.xHotspot;
pointer.hy = ii.yHotspot;
pointer.width = shapeInfo.Width;
pointer.height = shapeInfo.Height;
pointer.pitch = shapeInfo.Pitch;

View File

@@ -352,8 +352,8 @@ static int pointerThread(void * unused)
}
this->mouseVisible = pointer.visible;
this->mouseHotX = pointer.x;
this->mouseHotY = pointer.y;
this->mouseHotX = pointer.hx;
this->mouseHotY = pointer.hy;
}
if (events[0])

View File

@@ -288,8 +288,8 @@ CaptureResult NvFBCToSysGetCursor(NvFBCHandle handle, CapturePointer * pointer,
return CAPTURE_RESULT_ERROR;
}
pointer->x = params.dwXHotSpot;
pointer->y = params.dwYHotSpot;
pointer->hx = params.dwXHotSpot;
pointer->hy = params.dwYHotSpot;
pointer->width = params.dwWidth;
pointer->height = params.dwHeight;
pointer->pitch = params.dwPitch;
@@ -327,4 +327,4 @@ CaptureResult NvFBCToSysGetCursor(NvFBCHandle handle, CapturePointer * pointer,
memcpy(buffer, params.pBits, params.dwBufferSize);
return CAPTURE_RESULT_OK;
}
}