[c-host] inform the client if we have positional cursor information

This commit is contained in:
Geoffrey McRae
2020-01-26 17:25:14 +11:00
parent b4cf8f76c8
commit b7e4426002
5 changed files with 45 additions and 26 deletions

View File

@@ -312,10 +312,16 @@ void capturePostPointerBuffer(CapturePointer pointer)
app.pointerIndex = 0;
}
uint32_t flags = 0;
KVMFRCursor *cursor = lgmpHostMemPtr(mem);
cursor->x = pointer.x;
cursor->y = pointer.y;
cursor->visible = pointer.visible;
if (pointer.positionUpdate)
{
flags |= CURSOR_FLAG_POSITION;
cursor->x = pointer.x;
cursor->y = pointer.y;
cursor->visible = pointer.visible;
}
if (pointer.shapeUpdate)
{
@@ -337,11 +343,11 @@ void capturePostPointerBuffer(CapturePointer pointer)
app.pointerShapeValid = true;
}
const uint32_t sendShape =
((pointer.shapeUpdate || newClient) && app.pointerShapeValid) ? 1 : 0;
if ((pointer.shapeUpdate || newClient) && app.pointerShapeValid)
flags |= CURSOR_FLAG_SHAPE;
LGMP_STATUS status;
while ((status = lgmpHostQueuePost(app.pointerQueue, sendShape, mem)) != LGMP_OK)
while ((status = lgmpHostQueuePost(app.pointerQueue, flags, mem)) != LGMP_OK)
{
if (status == LGMP_ERR_QUEUE_FULL)
continue;