From nobody Tue Feb 10 05:26:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769201474239.73948421455884; Fri, 12 Jan 2018 07:00:01 -0800 (PST) Received: from localhost ([::1]:46192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0oH-00016q-RI for importer@patchew.org; Fri, 12 Jan 2018 09:59:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hf-0003mP-Qv for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hd-0005g2-0E for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57516) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hc-0005fE-QD for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:04 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC87CA49E7; Fri, 12 Jan 2018 14:53:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57FF66046B; Fri, 12 Jan 2018 14:53:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C76E8980C6; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:57 +0100 Message-Id: <20180112145258.10578-9-kraxel@redhat.com> In-Reply-To: <20180112145258.10578-1-kraxel@redhat.com> References: <20180112145258.10578-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 12 Jan 2018 14:53:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] sdl2 uses surface relative coordinates X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jindrich Makovicka , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jindrich Makovicka This patch fixes mouse positioning with -device usb-tablet and fullscreen or resized window. Fixes: 46522a82236ea0cf9011b89896d2d8f8ddaf2443 Signed-off-by: Jindrich Makovicka Message-Id: <20171117112258.5888-3-makovick@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 62a75318dd..8a0bd9149b 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -276,32 +276,10 @@ static void sdl_send_mouse_event(struct sdl2_console = *scon, int dx, int dy, } =20 if (qemu_input_is_absolute()) { - int scr_w, scr_h; - int max_w =3D 0, max_h =3D 0; - int off_x =3D 0, off_y =3D 0; - int cur_off_x =3D 0, cur_off_y =3D 0; - int i; - - for (i =3D 0; i < sdl2_num_outputs; i++) { - struct sdl2_console *thiscon =3D &sdl2_console[i]; - if (thiscon->real_window && thiscon->surface) { - SDL_GetWindowSize(thiscon->real_window, &scr_w, &scr_h); - cur_off_x =3D thiscon->x; - cur_off_y =3D thiscon->y; - if (scr_w + cur_off_x > max_w) { - max_w =3D scr_w + cur_off_x; - } - if (scr_h + cur_off_y > max_h) { - max_h =3D scr_h + cur_off_y; - } - if (i =3D=3D scon->idx) { - off_x =3D cur_off_x; - off_y =3D cur_off_y; - } - } - } - qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, off_x + x, 0, ma= x_w); - qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, off_y + y, 0, ma= x_h); + qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, + x, 0, surface_width(scon->surface)); + qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, + y, 0, surface_height(scon->surface)); } else { if (guest_cursor) { x -=3D guest_x; --=20 2.9.3