From 828cc1d4b7a99704041b7dbf48b7b49c555496dd Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 29 Oct 2017 15:08:11 +1100 Subject: [PATCH] [client] realign mouse when switching between capture modes --- client/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/main.c b/client/main.c index c49c315a..ae22a9da 100644 --- a/client/main.c +++ b/client/main.c @@ -425,6 +425,13 @@ int eventThread(void * arg) spice_mouse_mode(serverMode); SDL_SetRelativeMouseMode(serverMode); + if (!serverMode) + { + mouseX = state.shm->mouseX; + mouseY = state.shm->mouseY; + SDL_WarpMouseInWindow(state.window, mouseX, mouseY); + } + #ifdef DEBUG_INPUT_STATE DEBUG_INFO("mouse state:"); for (unsigned int i = 0; i < sizeof(state.mouse) / sizeof(bool); ++i)