[client] don't try to realign the mouse until we know where the mouse is

This commit is contained in:
Geoffrey McRae 2017-12-13 22:05:47 +11:00
parent 233b7755ae
commit afff50dfde

View File

@ -50,6 +50,7 @@ struct AppState
SDL_Point srcSize;
LG_RendererRect dstRect;
SDL_Point cursor;
bool haveCursorPos;
float scaleX, scaleY;
const LG_Renderer * lgr ;
@ -315,6 +316,7 @@ int renderThread(void * unused)
{
state.cursor.x = header.cursor.x;
state.cursor.y = header.cursor.y;
state.haveCursorPos = true;
}
if (header.cursor.flags & KVMFR_CURSOR_FLAG_SHAPE)
@ -526,7 +528,7 @@ int eventThread(void * arg)
int x = 0;
int y = 0;
if (realignGuest)
if (realignGuest && state.haveCursorPos)
{
x = event.motion.x - state.dstRect.x;
y = event.motion.y - state.dstRect.y;