From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYZg7-00089G-77 for qemu-devel@nongnu.org; Fri, 11 Apr 2014 07:31:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYZg1-000537-3F for qemu-devel@nongnu.org; Fri, 11 Apr 2014 07:31:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYZg0-00052y-SV for qemu-devel@nongnu.org; Fri, 11 Apr 2014 07:31:21 -0400 From: Gerd Hoffmann Date: Fri, 11 Apr 2014 12:40:16 +0200 Message-Id: <1397212816-19891-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1397212816-19891-1-git-send-email-kraxel@redhat.com> References: <1397212816-19891-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/2] input: sdl2: Fix relative mode to match SDL1 behavior List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori , Cole Robinson From: Cole Robinson 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 Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index e4cb9fb..7506e2e 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -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)) { -- 1.8.3.1