mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 22:01:46 +00:00
[client] core: wait for the host to process the cursor move
This commit is contained in:
parent
4b3a79c110
commit
e1a4401ffa
1 changed files with 27 additions and 4 deletions
|
@ -408,7 +408,6 @@ void core_handleMouseNormal(double ex, double ey)
|
|||
/* if we have been instructed to realign */
|
||||
if (g_cursor.realign)
|
||||
{
|
||||
g_cursor.realign = false;
|
||||
struct DoublePoint guest;
|
||||
util_localCurToGuest(&guest);
|
||||
|
||||
|
@ -416,11 +415,33 @@ void core_handleMouseNormal(double ex, double ey)
|
|||
{
|
||||
const KVMFRSetCursorPos msg = {
|
||||
.msg.type = KVMFR_MESSAGE_SETCURSORPOS,
|
||||
.x = guest.x,
|
||||
.y = guest.y
|
||||
.x = round(guest.x),
|
||||
.y = round(guest.y)
|
||||
};
|
||||
|
||||
lgmpClientSendData(g_state.pointerQueue, &msg, sizeof(msg), NULL);
|
||||
uint32_t setPosSerial;
|
||||
if (lgmpClientSendData(g_state.pointerQueue,
|
||||
&msg, sizeof(msg), &setPosSerial) == LGMP_OK)
|
||||
{
|
||||
/* wait for the move request to be processed */
|
||||
do
|
||||
{
|
||||
uint32_t hostSerial;
|
||||
if (lgmpClientGetSerial(g_state.pointerQueue, &hostSerial) != LGMP_OK)
|
||||
return;
|
||||
|
||||
if (hostSerial >= setPosSerial)
|
||||
break;
|
||||
|
||||
g_state.ds->wait(1);
|
||||
}
|
||||
while(app_isRunning());
|
||||
|
||||
g_cursor.guest.x = msg.x;
|
||||
g_cursor.guest.y = msg.y;
|
||||
g_cursor.realign = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -429,6 +450,8 @@ void core_handleMouseNormal(double ex, double ey)
|
|||
ey += guest.y - (g_cursor.guest.y + g_cursor.guest.hy);
|
||||
}
|
||||
|
||||
g_cursor.realign = false;
|
||||
|
||||
/* don't test for an exit as we just entered, we can get into a enter/exit
|
||||
* loop otherwise */
|
||||
testExit = false;
|
||||
|
|
Loading…
Reference in a new issue