mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-10 14:23:57 +00:00
[client] realign mouse on window changes
This commit is contained in:
parent
828cc1d4b7
commit
3907ded0c7
1 changed files with 11 additions and 0 deletions
|
@ -40,6 +40,8 @@ struct KVMGFXState
|
||||||
{
|
{
|
||||||
bool running;
|
bool running;
|
||||||
bool started;
|
bool started;
|
||||||
|
bool windowChanged;
|
||||||
|
|
||||||
SDL_Window * window;
|
SDL_Window * window;
|
||||||
SDL_Renderer * renderer;
|
SDL_Renderer * renderer;
|
||||||
struct KVMGFXHeader * shm;
|
struct KVMGFXHeader * shm;
|
||||||
|
@ -316,6 +318,7 @@ int renderThread(void * unused)
|
||||||
SDL_LockTexture(texture, NULL, (void**)&texPixels, &unused);
|
SDL_LockTexture(texture, NULL, (void**)&texPixels, &unused);
|
||||||
|
|
||||||
memcpy(&format, state.shm, sizeof(format));
|
memcpy(&format, state.shm, sizeof(format));
|
||||||
|
state.windowChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
glDisable(GL_COLOR_LOGIC_OP);
|
glDisable(GL_COLOR_LOGIC_OP);
|
||||||
|
@ -406,6 +409,14 @@ int eventThread(void * arg)
|
||||||
init = true;
|
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)
|
switch(event.type)
|
||||||
{
|
{
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
|
|
Loading…
Reference in a new issue