From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMzkG-0002eL-FG for qemu-devel@nongnu.org; Mon, 10 Mar 2014 08:55:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMzkA-0002s6-1k for qemu-devel@nongnu.org; Mon, 10 Mar 2014 08:55:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMzk9-0002ru-Qm for qemu-devel@nongnu.org; Mon, 10 Mar 2014 08:55:45 -0400 From: Gerd Hoffmann Date: Mon, 10 Mar 2014 13:54:34 +0100 Message-Id: <1394456075-20371-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1394456075-20371-1-git-send-email-kraxel@redhat.com> References: <1394456075-20371-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 1/2] input: sdl: fix guest_cursor logic. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori Unbreaks relative mouse mode with SDL. Reported-by: Gabriel L. Somlo Signed-off-by: Gerd Hoffmann --- ui/sdl.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ui/sdl.c b/ui/sdl.c index c1a16be..4e7f920 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -455,13 +455,17 @@ static void sdl_send_mouse_event(int dx, int dy, int x, int y, int state) real_screen->w); qemu_input_queue_abs(dcl->con, INPUT_AXIS_Y, y, real_screen->h); - } else if (guest_cursor) { - x -= guest_x; - y -= guest_y; - guest_x += x; - guest_y += y; - qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, x); - qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, y); + } else { + if (guest_cursor) { + x -= guest_x; + y -= guest_y; + guest_x += x; + guest_y += y; + dx = x; + dy = y; + } + qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, dx); + qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, dy); } qemu_input_event_sync(); } -- 1.8.3.1