From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFdY4-0006eQ-BH for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFdY1-00063U-6d for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:07:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58950) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFdY0-00060v-WA for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:06:57 -0500 From: Gerd Hoffmann Date: Fri, 17 Nov 2017 11:06:52 +0100 Message-Id: <20171117100653.13015-5-kraxel@redhat.com> In-Reply-To: <20171117100653.13015-1-kraxel@redhat.com> References: <20171117100653.13015-1-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 4/5] sdl2: Do not leave grab when fullscreen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jindrich Makovicka , Gerd Hoffmann From: Jindrich Makovicka Prevents displaying of a doubled mouse pointer when moving the pointer to the screen edges when fullscreen. Signed-off-by: Jindrich Makovicka Message-Id: <20171112193032.9724-8-makovick@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index cf05214f97..8360054094 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -471,8 +471,9 @@ static void handle_mousemotion(SDL_Event *ev) SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h); max_x = scr_w - 1; max_y = scr_h - 1; - if (gui_grab && (ev->motion.x == 0 || ev->motion.y == 0 || - ev->motion.x == max_x || ev->motion.y == max_y)) { + if (gui_grab && !gui_fullscreen + && (ev->motion.x == 0 || ev->motion.y == 0 || + ev->motion.x == max_x || ev->motion.y == max_y)) { sdl_grab_end(scon); } if (!gui_grab && -- 2.9.3