]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
sdl2: fix mouse grab
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 2 Feb 2018 12:08:03 +0000 (13:08 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 16 Feb 2018 11:32:35 +0000 (12:32 +0100)
When qemu mouse mode changes from relative to absolute
we must turn off sdl relative mouse mode too.

Fixes: https://bugs.launchpad.net/qemu/+bug/1703795
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20180202120803.11501-1-kraxel@redhat.com>

ui/sdl2.c

index 812c315891152b588787bb99232c03ec69881b73..858e04d7c082f669b37b34ed6295734222e7168c 100644 (file)
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -249,6 +249,7 @@ static void sdl_mouse_mode_change(Notifier *notify, void *data)
     if (qemu_input_is_absolute()) {
         if (!absolute_enabled) {
             absolute_enabled = 1;
+            SDL_SetRelativeMouseMode(SDL_FALSE);
             absolute_mouse_grab(&sdl2_console[0]);
         }
     } else if (absolute_enabled) {