diff options
author | Cole Robinson <crobinso@redhat.com> | 2014-04-01 16:37:11 -0400 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2014-04-11 12:19:16 +0200 |
commit | 2d968ffbae6b7899064f9f86f8508d9c19021e39 (patch) | |
tree | ac2f3a64ea475d0efff239f406ee008b59e6d892 /ui/sdl2.c | |
parent | afbc0dd649809b34583c52f2bc99b5c82c06fd53 (diff) |
input: sdl2: Fix relative mode to match SDL1 behavior
Right now relative mode accelerates too fast, and has the 'invisible wall'
problem. SDL2 added an explicit API to handle this use case, so let's use
it.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/sdl2.c')
-rw-r--r-- | ui/sdl2.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -278,7 +278,7 @@ static void sdl_hide_cursor(void) SDL_ShowCursor(1); SDL_SetCursor(sdl_cursor_hidden); } else { - SDL_ShowCursor(0); + SDL_SetRelativeMouseMode(SDL_TRUE); } } @@ -289,6 +289,7 @@ static void sdl_show_cursor(void) } if (!qemu_input_is_absolute()) { + SDL_SetRelativeMouseMode(SDL_FALSE); SDL_ShowCursor(1); if (guest_cursor && (gui_grab || qemu_input_is_absolute() || absolute_enabled)) { |