Skip to content

Commit

Permalink
[host] app: always send the cursor position to the client
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gnif committed Jul 5, 2021
1 parent dacd0ab commit ada6ada
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions host/src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ada6ada

Please sign in to comment.