mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-05-30 21:51:28 +00:00
[client] core: wait for the host to process the cursor move
This commit is contained in:
parent
4b3a79c110
commit
e1a4401ffa
@ -408,7 +408,6 @@ void core_handleMouseNormal(double ex, double ey)
|
|||||||
/* if we have been instructed to realign */
|
/* if we have been instructed to realign */
|
||||||
if (g_cursor.realign)
|
if (g_cursor.realign)
|
||||||
{
|
{
|
||||||
g_cursor.realign = false;
|
|
||||||
struct DoublePoint guest;
|
struct DoublePoint guest;
|
||||||
util_localCurToGuest(&guest);
|
util_localCurToGuest(&guest);
|
||||||
|
|
||||||
@ -416,11 +415,33 @@ void core_handleMouseNormal(double ex, double ey)
|
|||||||
{
|
{
|
||||||
const KVMFRSetCursorPos msg = {
|
const KVMFRSetCursorPos msg = {
|
||||||
.msg.type = KVMFR_MESSAGE_SETCURSORPOS,
|
.msg.type = KVMFR_MESSAGE_SETCURSORPOS,
|
||||||
.x = guest.x,
|
.x = round(guest.x),
|
||||||
.y = guest.y
|
.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
|
else
|
||||||
{
|
{
|
||||||
@ -429,6 +450,8 @@ void core_handleMouseNormal(double ex, double ey)
|
|||||||
ey += guest.y - (g_cursor.guest.y + g_cursor.guest.hy);
|
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
|
/* don't test for an exit as we just entered, we can get into a enter/exit
|
||||||
* loop otherwise */
|
* loop otherwise */
|
||||||
testExit = false;
|
testExit = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user