[client] realign mouse when switching between capture modes

This commit is contained in:
Geoffrey McRae 2017-10-29 15:08:11 +11:00
parent be792f33ce
commit 828cc1d4b7

View file

@ -425,6 +425,13 @@ int eventThread(void * arg)
spice_mouse_mode(serverMode); spice_mouse_mode(serverMode);
SDL_SetRelativeMouseMode(serverMode); SDL_SetRelativeMouseMode(serverMode);
if (!serverMode)
{
mouseX = state.shm->mouseX;
mouseY = state.shm->mouseY;
SDL_WarpMouseInWindow(state.window, mouseX, mouseY);
}
#ifdef DEBUG_INPUT_STATE #ifdef DEBUG_INPUT_STATE
DEBUG_INFO("mouse state:"); DEBUG_INFO("mouse state:");
for (unsigned int i = 0; i < sizeof(state.mouse) / sizeof(bool); ++i) for (unsigned int i = 0; i < sizeof(state.mouse) / sizeof(bool); ++i)