[host] app: always send the cursor position to the client

If the guest VM is not showing a cursor when it starts such as on the
Windows login screen, the client never gets the current position of the
cursor, which prevents the client from attempting to send mouse
movements. This change ensures the client gets the mouse location on
startup.
This commit is contained in:
Geoffrey McRae 2021-07-06 09:53:42 +10:00
parent dacd0ab844
commit ada6ada576

View File

@ -342,15 +342,13 @@ static void sendPointer(bool newClient)
// new clients need the last known shape and current position
if (newClient)
{
if (!app.pointerShapeValid)
return;
// update the saved details with the current cursor position
KVMFRCursor *cursor = lgmpHostMemPtr(app.pointerShape);
cursor->x = app.pointerInfo.x;
cursor->y = app.pointerInfo.y;
const uint32_t flags = CURSOR_FLAG_POSITION | CURSOR_FLAG_SHAPE |
const uint32_t flags = CURSOR_FLAG_POSITION |
(app.pointerShapeValid ? CURSOR_FLAG_SHAPE : 0) |
(app.pointerInfo.visible ? CURSOR_FLAG_VISIBLE : 0);
postPointer(flags, app.pointerShape);