From nobody Fri Apr 26 11:18:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1580988568694264.31316388994594; Thu, 6 Feb 2020 03:29:28 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-240-tFtZsRP3MVGWTzYU7AdyMw-1; Thu, 06 Feb 2020 06:29:25 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 16FD71835A14; Thu, 6 Feb 2020 11:29:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1C435DA7D; Thu, 6 Feb 2020 11:29:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3F623866A5; Thu, 6 Feb 2020 11:29:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 016BTETJ017479 for ; Thu, 6 Feb 2020 06:29:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id E8AA989F00; Thu, 6 Feb 2020 11:29:14 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id D444884DB8; Thu, 6 Feb 2020 11:29:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 05BEA9D7F; Thu, 6 Feb 2020 12:29:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988567; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ZjHJ0Bqyt9dFXRMBUV2U+b5uGLlCm46yUZcuR0/UrW0=; b=EY2Pw67PfvSBlP34uz/B26JKv66HdPjHudvvsGqv8lqVFm6yZ/jGv3+q2QE0tA2ONOWEpS T2BFekXHBtG5QrZ9j5SP69xAzfFDjQIOIZdI1x/g6++kwmxkbh7XIxabH7bcZktU3JJtCB z2w24msiFWEmwfJ1aEY03l9BgLnKzK0= From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 1/6] ui: add show-cursor option Date: Thu, 6 Feb 2020 12:29:03 +0100 Message-Id: <20200206112908.5002-2-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: tFtZsRP3MVGWTzYU7AdyMw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When enabled, this forces showing the mouse cursor, i.e. do not allow the guest to hide it. Defaults to off. Signed-off-by: Gerd Hoffmann Reviewed-by: J=C3=A1n Tomko Acked-by: Markus Armbruster --- qapi/ui.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qapi/ui.json b/qapi/ui.json index e04525d8b44b..b9df7fe7b5cb 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1144,6 +1144,8 @@ # @type: Which DisplayType qemu should use. # @full-screen: Start user interface in fullscreen mode (default: off). # @window-close: Allow to quit qemu with window close button (default: on= ). +# @show-cursor: Force showing the mouse cursor (default: off). +# Since: 5.0 # @gl: Enable OpenGL support (default: off). # # Since: 2.12 @@ -1153,6 +1155,7 @@ 'base' : { 'type' : 'DisplayType', '*full-screen' : 'bool', '*window-close' : 'bool', + '*show-cursor' : 'bool', '*gl' : 'DisplayGLMode' }, 'discriminator' : 'type', 'data' : { 'gtk' : 'DisplayGTK', --=20 2.18.1 From nobody Fri Apr 26 11:18:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1580988585948689.919839116732; Thu, 6 Feb 2020 03:29:45 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-bI2KjxCAPVqjBm8d8mJnzA-1; Thu, 06 Feb 2020 06:29:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C93F5101FC66; Thu, 6 Feb 2020 11:29:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0352790FF; Thu, 6 Feb 2020 11:29:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5BBF4866B0; Thu, 6 Feb 2020 11:29:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 016BTFCj017492 for ; Thu, 6 Feb 2020 06:29:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 25D921001B09; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF85110016DA; Thu, 6 Feb 2020 11:29:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0E0949D14; Thu, 6 Feb 2020 12:29:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988584; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RodwXT1V2+0JjqSWCZGAHL7wdPoLcCIjVfQumGdbC6U=; b=CT2239zPn5JrgGJs923yxNtab5XdPtREieC5XfrSaZP8ivoG/q/OyEcgIvBQBFkvEFyDHw h3qYT7irOuBQs5jcbAd4ROfIpuzjWbdgPiKMHRZuRLBQ2SZBU1YsvaGi2m2XtAYPShnN5K 5IVVgsSYF4fQTNyzB19qzmvHQ4OR/7I= From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 2/6] ui/gtk: implement show-cursor option Date: Thu, 6 Feb 2020 12:29:04 +0100 Message-Id: <20200206112908.5002-3-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: bI2KjxCAPVqjBm8d8mJnzA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: J=C3=A1n Tomko --- ui/gtk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index d18892d1de61..78b197ade4c1 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -247,6 +247,7 @@ static void gd_update_cursor(VirtualConsole *vc) { GtkDisplayState *s =3D vc->s; GdkWindow *window; + bool allow_hide_cursor =3D true; =20 if (vc->type !=3D GD_VC_GFX || !qemu_console_is_graphic(vc->gfx.dcl.con)) { @@ -257,8 +258,13 @@ static void gd_update_cursor(VirtualConsole *vc) return; } =20 + if (s->opts->has_show_cursor && s->opts->show_cursor) { + allow_hide_cursor =3D false; + } + window =3D gtk_widget_get_window(GTK_WIDGET(vc->gfx.drawing_area)); - if (s->full_screen || qemu_input_is_absolute() || s->ptr_owner =3D=3D = vc) { + if (allow_hide_cursor && + (s->full_screen || qemu_input_is_absolute() || s->ptr_owner =3D=3D= vc)) { gdk_window_set_cursor(window, s->null_cursor); } else { gdk_window_set_cursor(window, NULL); --=20 2.18.1 From nobody Fri Apr 26 11:18:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580988587745912.217723842685; Thu, 6 Feb 2020 03:29:47 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-JgUo1IpmNtylJxOSk91CtQ-1; Thu, 06 Feb 2020 06:29:45 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFD41DB2A; Thu, 6 Feb 2020 11:29:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A954E5DA84; Thu, 6 Feb 2020 11:29:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5C84418089CD; Thu, 6 Feb 2020 11:29:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 016BTFXS017499 for ; Thu, 6 Feb 2020 06:29:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3C3AB26FD2; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9C7B26FB0; Thu, 6 Feb 2020 11:29:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 165769D1E; Thu, 6 Feb 2020 12:29:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988586; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4IyWKhwRUQwRI8lwf4+TcJFmra3ViPznqxEAADo0NuY=; b=NIZV+Lv6wdlWDjRnbOiGuRbrYXlCzd+YIBZLGZjgbFFztH9WuNY6NN8QGaEQ4jScJB0gLp CmtnqTRkBaF1Q5Ds1NGvOpF98YYY2H1c1GAw1rWqw1P2mwU/ZbyhLw9sicubqLB0xXe2HB XnBw3Jp5r+eq1wV0HPQ3vtmLr5vo5u8= From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 3/6] ui/sdl: implement show-cursor option Date: Thu, 6 Feb 2020 12:29:05 +0100 Message-Id: <20200206112908.5002-4-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: JgUo1IpmNtylJxOSk91CtQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: J=C3=A1n Tomko --- ui/sdl2.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 9030f1c42efb..e18555b10a42 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -161,9 +161,15 @@ static void sdl_update_caption(struct sdl2_console *sc= on) } } =20 -static void sdl_hide_cursor(void) +static void sdl_hide_cursor(struct sdl2_console *scon) { - if (!cursor_hide) { + bool allow_hide_cursor =3D true; + + if (scon->opts->has_show_cursor && scon->opts->show_cursor) { + allow_hide_cursor =3D false; + } + + if (!allow_hide_cursor) { return; } =20 @@ -175,9 +181,15 @@ static void sdl_hide_cursor(void) } } =20 -static void sdl_show_cursor(void) +static void sdl_show_cursor(struct sdl2_console *scon) { - if (!cursor_hide) { + bool allow_hide_cursor =3D true; + + if (scon->opts->has_show_cursor && scon->opts->show_cursor) { + allow_hide_cursor =3D false; + } + + if (!allow_hide_cursor) { return; } =20 @@ -216,7 +228,7 @@ static void sdl_grab_start(struct sdl2_console *scon) SDL_WarpMouseInWindow(scon->real_window, guest_x, guest_y); } } else { - sdl_hide_cursor(); + sdl_hide_cursor(scon); } SDL_SetWindowGrab(scon->real_window, SDL_TRUE); gui_grab =3D 1; @@ -227,7 +239,7 @@ static void sdl_grab_end(struct sdl2_console *scon) { SDL_SetWindowGrab(scon->real_window, SDL_FALSE); gui_grab =3D 0; - sdl_show_cursor(); + sdl_show_cursor(scon); sdl_update_caption(scon); } =20 @@ -658,7 +670,7 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl, =20 if (on) { if (!guest_cursor) { - sdl_show_cursor(); + sdl_show_cursor(scon); } if (gui_grab || qemu_input_is_absolute() || absolute_enabled) { SDL_SetCursor(guest_sprite); @@ -667,7 +679,7 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl, } } } else if (gui_grab) { - sdl_hide_cursor(); + sdl_hide_cursor(scon); } guest_cursor =3D on; guest_x =3D x, guest_y =3D y; --=20 2.18.1 From nobody Fri Apr 26 11:18:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580988575995394.7853080219961; Thu, 6 Feb 2020 03:29:35 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-245-ifr-6JZ8OSSfGS3FXaVCEA-1; Thu, 06 Feb 2020 06:29:32 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 493A91835A14; Thu, 6 Feb 2020 11:29:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E10060C18; Thu, 6 Feb 2020 11:29:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A176818089CF; Thu, 6 Feb 2020 11:29:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 016BTFhQ017489 for ; Thu, 6 Feb 2020 06:29:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 190588E9E5; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEE118DC1B; Thu, 6 Feb 2020 11:29:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1EA979AA8; Thu, 6 Feb 2020 12:29:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988575; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yGM7ZkMiZ6BMOLpHtzcPIS6l33t7CB4OzRG+MiB3VeE=; b=EpPMTSpbVDO+vADgg6E0FTxrW1Y1Xi55SSzwD0/uu7EwV3JsqpZXY1rQFoWrCfX2ZPNC58 EjxJryrWEEXzt7xBSIKzol2w1Ix2aqpAXGWtJ2Ut6O2skbesi1+3gx+EgalyceUo8m1bZR qqLBvtziKEVNFCTwUyPJojbsLh+jngo= From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 4/6] ui/cocoa: implement show-cursor option Date: Thu, 6 Feb 2020 12:29:06 +0100 Message-Id: <20200206112908.5002-5-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: ifr-6JZ8OSSfGS3FXaVCEA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- ui/cocoa.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index fbb5b1b45f81..f7b323044582 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -125,6 +125,7 @@ typedef struct { NSWindow *normalWindow, *about_window; static DisplayChangeListener *dcl; static int last_buttons; +static int cursor_hide =3D 1; =20 int gArgc; char **gArgv; @@ -1918,6 +1919,9 @@ static void cocoa_display_init(DisplayState *ds, Disp= layOptions *opts) [(QemuCocoaAppController *)[[NSApplication sharedApplication] = delegate] toggleFullScreen: nil]; }); } + if (opts->has_show_cursor && opts->show_cursor) { + cursor_hide =3D 0; + } =20 dcl =3D g_malloc0(sizeof(DisplayChangeListener)); =20 --=20 2.18.1 From nobody Fri Apr 26 11:18:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1580988592626629.7810181737719; Thu, 6 Feb 2020 03:29:52 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-nkHmUVWxPgW-g6rWjtXDcw-1; Thu, 06 Feb 2020 06:29:48 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 756D9104FB67; Thu, 6 Feb 2020 11:29:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4BB3B10018FF; Thu, 6 Feb 2020 11:29:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 043E518089D5; Thu, 6 Feb 2020 11:29:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 016BTG4L017509 for ; Thu, 6 Feb 2020 06:29:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 28D1E26FD2; Thu, 6 Feb 2020 11:29:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id C222226FA8; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 282391FCD6; Thu, 6 Feb 2020 12:29:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988591; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VV+baVbE0iCSyAaPQPldJWITCP9tg+jCQxrFr9GIeHA=; b=AQYeLQALPH9Ji+M+d0Vfa+YCtrU+LCzlz3V8dHdkw+smGCy8cpUoQbbG1IUL92c/05TUtY xhjSjFKr1Il1ofr8okq6ZU5sI4fBLKlyg9406L6suSe/XFlb71gBft1fcy2I8UDp/H6GK9 efwrNO6WrgWgcwlKMcFXCd0EZtAmERc= From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 5/6] ui: wire up legacy -show-cursor option Date: Thu, 6 Feb 2020 12:29:07 +0100 Message-Id: <20200206112908.5002-6-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: nkHmUVWxPgW-g6rWjtXDcw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/sysemu/sysemu.h | 1 - vl.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 6358a324a711..7956e9054ade 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -41,7 +41,6 @@ extern const char *keyboard_layout; extern int win2k_install_hack; extern int alt_grab; extern int ctrl_grab; -extern int cursor_hide; extern int graphic_rotate; extern int no_shutdown; extern int old_param; diff --git a/vl.c b/vl.c index 7dcb0879c497..fd96d04578cd 100644 --- a/vl.c +++ b/vl.c @@ -168,7 +168,6 @@ int no_hpet =3D 0; int fd_bootchk =3D 1; static int no_reboot; int no_shutdown =3D 0; -int cursor_hide =3D 1; int graphic_rotate =3D 0; const char *watchdog; QEMUOptionRom option_rom[MAX_OPTION_ROMS]; @@ -3553,7 +3552,8 @@ int main(int argc, char **argv, char **envp) no_shutdown =3D 1; break; case QEMU_OPTION_show_cursor: - cursor_hide =3D 0; + dpy.has_show_cursor =3D true; + dpy.show_cursor =3D true; break; case QEMU_OPTION_uuid: if (qemu_uuid_parse(optarg, &qemu_uuid) < 0) { --=20 2.18.1 From nobody Fri Apr 26 11:18:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580988569713193.46232255961831; Thu, 6 Feb 2020 03:29:29 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-H5POHhm4NOCf0R67GpBiXA-1; Thu, 06 Feb 2020 06:29:26 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3FE3C800D54; Thu, 6 Feb 2020 11:29:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B2C675DA7E; Thu, 6 Feb 2020 11:29:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 127A91809567; Thu, 6 Feb 2020 11:29:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 016BTGmU017504 for ; Thu, 6 Feb 2020 06:29:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1B8DF5DA87; Thu, 6 Feb 2020 11:29:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6EE05DA7D; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 31B801FCDA; Thu, 6 Feb 2020 12:29:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988568; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=q1Ppgvtxuqv/cQY2jtSC5bIqDJzrtCGOk93IFYtq2aQ=; b=fiFqM9RclJukFC6eagPFnFE1I8u71qgQnS+ZvHzhSaxuHPjuhZZh8+ODw3uEik9aQMzSi4 K+ObRzeS1YrkoVANAg9agNVvdivLBy0Y2NTSG2fWNuCXFbsndT1Lv9bLqcjXf2nCNHohqU hnmnedGOnJwnrkBdH8RCzq4Vl8YQIjY= From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 6/6] ui: deprecate legacy -show-cursor option Date: Thu, 6 Feb 2020 12:29:08 +0100 Message-Id: <20200206112908.5002-7-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: H5POHhm4NOCf0R67GpBiXA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: J=C3=A1n Tomko --- vl.c | 2 ++ qemu-deprecated.texi | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/vl.c b/vl.c index fd96d04578cd..2f8b9753b49d 100644 --- a/vl.c +++ b/vl.c @@ -3552,6 +3552,8 @@ int main(int argc, char **argv, char **envp) no_shutdown =3D 1; break; case QEMU_OPTION_show_cursor: + warn_report("The -show-cursor option is deprecated, " + "use -display {sdl,gtk},show-cursor=3Don inste= ad"); dpy.has_show_cursor =3D true; dpy.show_cursor =3D true; break; diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index ea3e10bde398..c1444d1839bd 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -148,6 +148,11 @@ QEMU 5.0 introduced an alternative syntax to specify t= he size of the translation block cache, @option{-accel tcg,tb-size=3D}. The new syntax deprecates the previously available @option{-tb-size} option. =20 +@subsection -show-cursor option (since 5.0) + +Use @option{-display sdl,show-cursor=3Don} or + @option{-display gtk,show-cursor=3Don} instead. + @section QEMU Machine Protocol (QMP) commands =20 @subsection change (since 2.5.0) --=20 2.18.1