From nobody Tue Feb 10 05:26:25 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769572593652.1983739600998; Fri, 12 Jan 2018 07:06:12 -0800 (PST) Received: from localhost ([::1]:46487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0u8-0007d7-4F for importer@patchew.org; Fri, 12 Jan 2018 10:06:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0hg-0003nM-Hx for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0hf-0005j6-Fb for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54510) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0hf-0005iH-7o for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:53:07 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4997D85550; Fri, 12 Jan 2018 14:53:06 +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 56D9B909EF; Fri, 12 Jan 2018 14:53:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BF90241ABE; Fri, 12 Jan 2018 15:52:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:52:56 +0100 Message-Id: <20180112145258.10578-8-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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 12 Jan 2018 14:53:06 +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 7/9] sdl2: Do not hide the cursor on auxilliary windows 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 Signed-off-by: Jindrich Makovicka Message-Id: <20171117112258.5888-2-makovick@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 8718cf36b5..62a75318dd 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -466,6 +466,10 @@ static void handle_mousemotion(SDL_Event *ev) int max_x, max_y; struct sdl2_console *scon =3D get_scon_from_window(ev->key.windowID); =20 + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (qemu_input_is_absolute() || absolute_enabled) { int scr_w, scr_h; SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h); @@ -494,6 +498,10 @@ static void handle_mousebutton(SDL_Event *ev) SDL_MouseButtonEvent *bev; struct sdl2_console *scon =3D get_scon_from_window(ev->key.windowID); =20 + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + bev =3D &ev->button; if (!gui_grab && !qemu_input_is_absolute()) { if (ev->type =3D=3D SDL_MOUSEBUTTONUP && bev->button =3D=3D SDL_BU= TTON_LEFT) { @@ -516,6 +524,10 @@ static void handle_mousewheel(SDL_Event *ev) SDL_MouseWheelEvent *wev =3D &ev->wheel; InputButton btn; =20 + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (wev->y > 0) { btn =3D INPUT_BUTTON_WHEEL_UP; } else if (wev->y < 0) { @@ -657,6 +669,11 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl, int x, int y, int on) { struct sdl2_console *scon =3D container_of(dcl, struct sdl2_console, d= cl); + + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (on) { if (!guest_cursor) { sdl_show_cursor(); --=20 2.9.3