From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV5RC-0006Xm-GC for qemu-devel@nongnu.org; Tue, 01 Apr 2014 16:37:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WV5R0-0002Vf-KA for qemu-devel@nongnu.org; Tue, 01 Apr 2014 16:37:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV5R0-0002UZ-Bc for qemu-devel@nongnu.org; Tue, 01 Apr 2014 16:37:26 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s31KbPvJ009770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Apr 2014 16:37:25 -0400 From: Cole Robinson Date: Tue, 1 Apr 2014 16:37:11 -0400 Message-Id: <69d314c56efa6d68d3cdf0c56344469c0b70c175.1396383249.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [RFC PATCH 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 , 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 --- While this fixes things for me, I'm not positive it doesn't have other side effects. I didn't test transition from relative mode to absolute mode and back, which might hit issues. 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.9.0