[client] core: fallback to manual realignment if the LGMP message fails

This commit is contained in:
Geoffrey McRae 2022-01-09 16:50:47 +11:00
parent 3ffefb5281
commit 0fc87576f3

View File

@ -468,8 +468,14 @@ void core_handleMouseNormal(double ex, double ey)
};
uint32_t setPosSerial;
if (lgmpClientSendData(g_state.pointerQueue,
&msg, sizeof(msg), &setPosSerial) == LGMP_OK)
LGMP_STATUS status;
if ((status = lgmpClientSendData(g_state.pointerQueue,
&msg, sizeof(msg), &setPosSerial)) != LGMP_OK)
{
DEBUG_WARN("Message send failed: %s", lgmpStatusString(status));
goto fallback;
}
else
{
/* wait for the move request to be processed */
do
@ -498,6 +504,7 @@ void core_handleMouseNormal(double ex, double ey)
}
else
{
fallback:
/* add the difference to the offset */
ex += guest.x - (g_cursor.guest.x + g_cursor.guest.hx);
ey += guest.y - (g_cursor.guest.y + g_cursor.guest.hy);