mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-21 21:17:19 +00:00
[client] realign mouse on window changes
This commit is contained in:
parent
828cc1d4b7
commit
3907ded0c7
@ -40,6 +40,8 @@ struct KVMGFXState
|
||||
{
|
||||
bool running;
|
||||
bool started;
|
||||
bool windowChanged;
|
||||
|
||||
SDL_Window * window;
|
||||
SDL_Renderer * renderer;
|
||||
struct KVMGFXHeader * shm;
|
||||
@ -316,6 +318,7 @@ int renderThread(void * unused)
|
||||
SDL_LockTexture(texture, NULL, (void**)&texPixels, &unused);
|
||||
|
||||
memcpy(&format, state.shm, sizeof(format));
|
||||
state.windowChanged = true;
|
||||
}
|
||||
|
||||
glDisable(GL_COLOR_LOGIC_OP);
|
||||
@ -406,6 +409,14 @@ int eventThread(void * arg)
|
||||
init = true;
|
||||
}
|
||||
|
||||
if (state.windowChanged)
|
||||
{
|
||||
mouseX = state.shm->mouseX;
|
||||
mouseY = state.shm->mouseY;
|
||||
SDL_WarpMouseInWindow(state.window, mouseX, mouseY);
|
||||
state.windowChanged = false;
|
||||
}
|
||||
|
||||
switch(event.type)
|
||||
{
|
||||
case SDL_KEYDOWN:
|
||||
|
Loading…
Reference in New Issue
Block a user