From nobody Sat Apr 27 07:18:22 2024 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 1517243369569568.481507493678; Mon, 29 Jan 2018 08:29:29 -0800 (PST) Received: from localhost ([::1]:48442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCJE-0003Ya-MF for importer@patchew.org; Mon, 29 Jan 2018 11:29:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEA-0007xI-Jc for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCE7-0002Mi-VG for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39210) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCE7-0002Lf-Os for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:11 -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 mx1.redhat.com (Postfix) with ESMTPS id EA6AE1752C0 for ; Mon, 29 Jan 2018 16:24:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id ECBA860C82; Mon, 29 Jan 2018 16:24:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0763511ABC; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:23:57 +0100 Message-Id: <20180129162408.415-2-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 29 Jan 2018 16:24:10 +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] [PATCH v2 01/12] vl: deprecate -no-frame 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: Paolo Bonzini , 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" Signed-off-by: Gerd Hoffmann --- vl.c | 4 ++++ qemu-doc.texi | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/vl.c b/vl.c index e517a8d995..ac0efca708 100644 --- a/vl.c +++ b/vl.c @@ -2104,6 +2104,8 @@ static DisplayType select_display(const char *p) const char *nextopt; =20 if (strstart(opts, ",frame=3D", &nextopt)) { + g_printerr("The frame=3D sdl option is deprecated, and wil= l be\n" + "removed in a future release.\n"); opts =3D nextopt; if (strstart(opts, "on", &nextopt)) { no_frame =3D 0; @@ -3642,6 +3644,8 @@ int main(int argc, char **argv, char **envp) full_screen =3D 1; break; case QEMU_OPTION_no_frame: + g_printerr("The -no-frame switch is deprecated, and will b= e\n" + "removed in a future release.\n"); no_frame =3D 1; break; case QEMU_OPTION_alt_grab: diff --git a/qemu-doc.texi b/qemu-doc.texi index 79d08b3f04..cd8d96f0d3 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2749,6 +2749,13 @@ filesystem test suite. Also it requires the CAP_DAC_= READ_SEARCH capability, which is not the recommended way to run QEMU. This backend should not be used and it will be removed with no replacement. =20 +@subsection -no-frame (since 2.12.0) + +The ``-no-frame'' argument works with SDL 1.2 only. SDL 2.0 lacks +support for frameless windows, and the other user interfaces never +implemented this in the first place. So this will be removed together +with SDL 1.2 support. + @section qemu-img command line arguments =20 @subsection convert -s (since 2.0.0) --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243370766885.5919687884164; Mon, 29 Jan 2018 08:29:30 -0800 (PST) Received: from localhost ([::1]:48443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCJF-0003Zo-Rh for importer@patchew.org; Mon, 29 Jan 2018 11:29:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEF-0007zM-Em for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCE9-0002Oa-KJ for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39268) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCE9-0002Nk-EE for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:13 -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 mx1.redhat.com (Postfix) with ESMTPS id B2BCB1752A8 for ; Mon, 29 Jan 2018 16:24:12 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9E985D75D; Mon, 29 Jan 2018 16:24:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 10E1711ABD; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:23:58 +0100 Message-Id: <20180129162408.415-3-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 29 Jan 2018 16:24:12 +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] [PATCH v2 02/12] vl: deprecate -alt-grab and -ctrl-grab 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: Paolo Bonzini , 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" Signed-off-by: Gerd Hoffmann --- vl.c | 8 ++++++++ qemu-doc.texi | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/vl.c b/vl.c index ac0efca708..fa19a61500 100644 --- a/vl.c +++ b/vl.c @@ -2115,6 +2115,8 @@ static DisplayType select_display(const char *p) goto invalid_sdl_args; } } else if (strstart(opts, ",alt_grab=3D", &nextopt)) { + g_printerr("The alt_grab=3D sdl option is deprecated, and = will be\n" + "removed in a future release.\n"); opts =3D nextopt; if (strstart(opts, "on", &nextopt)) { alt_grab =3D 1; @@ -2124,6 +2126,8 @@ static DisplayType select_display(const char *p) goto invalid_sdl_args; } } else if (strstart(opts, ",ctrl_grab=3D", &nextopt)) { + g_printerr("The ctrl_grab=3D sdl option is deprecated, and= will be\n" + "removed in a future release.\n"); opts =3D nextopt; if (strstart(opts, "on", &nextopt)) { ctrl_grab =3D 1; @@ -3649,9 +3653,13 @@ int main(int argc, char **argv, char **envp) no_frame =3D 1; break; case QEMU_OPTION_alt_grab: + g_printerr("The -alt-grab switch is deprecated, and will b= e\n" + "removed in a future release.\n"); alt_grab =3D 1; break; case QEMU_OPTION_ctrl_grab: + g_printerr("The -ctrl-grab switch is deprecated, and will = be\n" + "removed in a future release.\n"); ctrl_grab =3D 1; break; case QEMU_OPTION_no_quit: diff --git a/qemu-doc.texi b/qemu-doc.texi index cd8d96f0d3..6d167a6949 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2756,6 +2756,12 @@ support for frameless windows, and the other user in= terfaces never implemented this in the first place. So this will be removed together with SDL 1.2 support. =20 +@subsection -alt-grab and -ctrl-grab (since 2.12.0) + +The ``-alt-grab'' and ``-ctrl-grab'' arguments are deprecated. They +work with SDL only. They will eventually replaced with a new way to +configure hotkeys which works consistently across all user interfaces. + @section qemu-img command line arguments =20 @subsection convert -s (since 2.0.0) --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243194192949.5073225350669; Mon, 29 Jan 2018 08:26:34 -0800 (PST) Received: from localhost ([::1]:48427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCGF-0000qn-DS for importer@patchew.org; Mon, 29 Jan 2018 11:26:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEA-0007xH-If for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCE7-0002Md-Ui for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45770) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCE7-0002LZ-Oy for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:11 -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 D40BFC059726 for ; Mon, 29 Jan 2018 16:24:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE12E18AB0; Mon, 29 Jan 2018 16:24:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1922B11ABE; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:23:59 +0100 Message-Id: <20180129162408.415-4-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-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.32]); Mon, 29 Jan 2018 16:24:10 +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] [PATCH v2 03/12] vl: rename DisplayType to LegacyDisplayType 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: Paolo Bonzini , 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" qapi DisplayType will replace the current enum. For the transition both will coexist though, so rename it so we don't have a name clash. Signed-off-by: Gerd Hoffmann --- vl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vl.c b/vl.c index fa19a61500..a2478412c7 100644 --- a/vl.c +++ b/vl.c @@ -2082,7 +2082,7 @@ static void select_vgahw(const char *p) } } =20 -typedef enum DisplayType { +typedef enum LegacyDisplayType { DT_DEFAULT, DT_CURSES, DT_SDL, @@ -2090,12 +2090,12 @@ typedef enum DisplayType { DT_GTK, DT_EGL, DT_NONE, -} DisplayType; +} LegacyDisplayType; =20 -static DisplayType select_display(const char *p) +static LegacyDisplayType select_display(const char *p) { const char *opts; - DisplayType display =3D DT_DEFAULT; + LegacyDisplayType display =3D DT_DEFAULT; =20 if (strstart(p, "sdl", &opts)) { #ifdef CONFIG_SDL @@ -3058,7 +3058,7 @@ int main(int argc, char **argv, char **envp) const char *incoming =3D NULL; bool userconfig =3D true; bool nographic =3D false; - DisplayType display_type =3D DT_DEFAULT; + LegacyDisplayType display_type =3D DT_DEFAULT; int display_remote =3D 0; const char *log_mask =3D NULL; const char *log_file =3D NULL; --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243547655359.4556697204025; Mon, 29 Jan 2018 08:32:27 -0800 (PST) Received: from localhost ([::1]:48571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCM1-0005ri-FY for importer@patchew.org; Mon, 29 Jan 2018 11:32:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEF-0007zW-LV for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCEA-0002PB-5u for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45838) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCE9-0002O4-TQ for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:14 -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 mx1.redhat.com (Postfix) with ESMTPS id 3425EC056786 for ; Mon, 29 Jan 2018 16:24:13 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE0A760C90; Mon, 29 Jan 2018 16:24:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 25F1616E03; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:00 +0100 Message-Id: <20180129162408.415-5-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 29 Jan 2018 16:24:13 +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] [PATCH v2 04/12] gtk: add and use DisplayOptions + DisplayGTK 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: Paolo Bonzini , Gerd Hoffmann , Markus Armbruster 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" Add QAPI DisplayType enum, DisplayOptions union and DisplayGTK struct. Switch gtk configuration to use the qapi type. Some bookkeeping (fullscreen for example) is done twice now, this is temporary until more/all UIs are switched over to qapi configuration. Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 9 ++++---- ui/gtk.c | 32 +++++++++++++++------------- vl.c | 23 +++++++++++++++----- qapi/ui.json | 59 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 99 insertions(+), 24 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 7b35778444..58d1a3d27c 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -511,18 +511,17 @@ int index_from_key(const char *key, size_t key_length= ); =20 /* gtk.c */ #ifdef CONFIG_GTK -void early_gtk_display_init(int opengl); -void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hov= er); +void early_gtk_display_init(DisplayOptions *opts); +void gtk_display_init(DisplayState *ds, DisplayOptions *opts); #else -static inline void gtk_display_init(DisplayState *ds, bool full_screen, - bool grab_on_hover) +static inline void gtk_display_init(DisplayState *ds, DisplayOptions *opts) { /* This must never be called if CONFIG_GTK is disabled */ error_report("GTK support is disabled"); abort(); } =20 -static inline void early_gtk_display_init(int opengl) +static inline void early_gtk_display_init(DisplayOptions *opts) { /* This must never be called if CONFIG_GTK is disabled */ error_report("GTK support is disabled"); diff --git a/ui/gtk.c b/ui/gtk.c index f0ad63e431..c12d5e020c 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -229,6 +229,8 @@ struct GtkDisplayState { =20 bool modifier_pressed[ARRAY_SIZE(modifier_keycode)]; bool ignore_keys; + + DisplayOptions *opts; }; =20 typedef struct VCChardev { @@ -777,9 +779,14 @@ static gboolean gd_window_close(GtkWidget *widget, Gdk= Event *event, void *opaque) { GtkDisplayState *s =3D opaque; + bool allow_close =3D true; int i; =20 - if (!no_quit) { + if (s->opts->has_window_close && !s->opts->window_close) { + allow_close =3D false; + } + + if (allow_close) { for (i =3D 0; i < s->nb_vcs; i++) { if (s->vc[i].type !=3D GD_VC_GFX) { continue; @@ -2289,7 +2296,7 @@ static void gd_create_menus(GtkDisplayState *s) =20 static gboolean gtkinit; =20 -void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hov= er) +void gtk_display_init(DisplayState *ds, DisplayOptions *opts) { VirtualConsole *vc; =20 @@ -2301,6 +2308,8 @@ void gtk_display_init(DisplayState *ds, bool full_scr= een, bool grab_on_hover) fprintf(stderr, "gtk initialization failed\n"); exit(1); } + assert(opts->type =3D=3D DISPLAY_TYPE_GTK); + s->opts =3D opts; =20 #if !GTK_CHECK_VERSION(3, 0, 0) g_printerr("Running QEMU with GTK 2.x is deprecated, and will be remov= ed\n" @@ -2387,15 +2396,17 @@ void gtk_display_init(DisplayState *ds, bool full_s= creen, bool grab_on_hover) vc && vc->type =3D=3D GD_VC_VTE); #endif =20 - if (full_screen) { + if (opts->has_full_screen && + opts->full_screen) { gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item)); } - if (grab_on_hover) { + if (opts->u.gtk.has_grab_on_hover && + opts->u.gtk.grab_on_hover) { gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item)); } } =20 -void early_gtk_display_init(int opengl) +void early_gtk_display_init(DisplayOptions *opts) { /* The QEMU code relies on the assumption that it's always run in * the C locale. Therefore it is not prepared to deal with @@ -2421,11 +2432,8 @@ void early_gtk_display_init(int opengl) return; } =20 - switch (opengl) { - case -1: /* default */ - case 0: /* off */ - break; - case 1: /* on */ + assert(opts->type =3D=3D DISPLAY_TYPE_GTK); + if (opts->has_gl && opts->gl) { #if defined(CONFIG_OPENGL) #if defined(CONFIG_GTK_GL) gtk_gl_area_init(); @@ -2433,10 +2441,6 @@ void early_gtk_display_init(int opengl) gtk_egl_init(); #endif #endif - break; - default: - g_assert_not_reached(); - break; } =20 keycode_map =3D gd_get_keymap(&keycode_maplen); diff --git a/vl.c b/vl.c index a2478412c7..4a555de0cf 100644 --- a/vl.c +++ b/vl.c @@ -150,9 +150,9 @@ static int rtc_date_offset =3D -1; /* -1 means no chang= e */ QEMUClockType rtc_clock; int vga_interface_type =3D VGA_NONE; static int full_screen =3D 0; +static DisplayOptions dpy; int no_frame; int no_quit =3D 0; -static bool grab_on_hover; Chardev *serial_hds[MAX_SERIAL_PORTS]; Chardev *parallel_hds[MAX_PARALLEL_PORTS]; Chardev *virtcon_hds[MAX_VIRTIO_CONSOLES]; @@ -2191,24 +2191,29 @@ static LegacyDisplayType select_display(const char = *p) } else if (strstart(p, "gtk", &opts)) { #ifdef CONFIG_GTK display =3D DT_GTK; + dpy.type =3D DISPLAY_TYPE_GTK; while (*opts) { const char *nextopt; =20 if (strstart(opts, ",grab_on_hover=3D", &nextopt)) { opts =3D nextopt; + dpy.u.gtk.has_grab_on_hover =3D true; if (strstart(opts, "on", &nextopt)) { - grab_on_hover =3D true; + dpy.u.gtk.grab_on_hover =3D true; } else if (strstart(opts, "off", &nextopt)) { - grab_on_hover =3D false; + dpy.u.gtk.grab_on_hover =3D false; } else { goto invalid_gtk_args; } } else if (strstart(opts, ",gl=3D", &nextopt)) { opts =3D nextopt; + dpy.has_gl =3D true; if (strstart(opts, "on", &nextopt)) { request_opengl =3D 1; + dpy.gl =3D true; } else if (strstart(opts, "off", &nextopt)) { request_opengl =3D 0; + dpy.gl =3D false; } else { goto invalid_gtk_args; } @@ -2225,6 +2230,7 @@ static LegacyDisplayType select_display(const char *p) #endif } else if (strstart(p, "none", &opts)) { display =3D DT_NONE; + dpy.type =3D DISPLAY_TYPE_NONE; } else { error_report("unknown display type"); exit(1); @@ -3259,6 +3265,7 @@ int main(int argc, char **argv, char **envp) qemu_opts_parse_noisily(olist, "graphics=3Doff", false); nographic =3D true; display_type =3D DT_NONE; + dpy.type =3D DISPLAY_TYPE_NONE; break; case QEMU_OPTION_curses: #ifdef CONFIG_CURSES @@ -3646,6 +3653,8 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_full_screen: full_screen =3D 1; + dpy.has_full_screen =3D true; + dpy.full_screen =3D true; break; case QEMU_OPTION_no_frame: g_printerr("The -no-frame switch is deprecated, and will b= e\n" @@ -3664,6 +3673,8 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_no_quit: no_quit =3D 1; + dpy.has_window_close =3D true; + dpy.window_close =3D false; break; case QEMU_OPTION_sdl: #ifdef CONFIG_SDL @@ -4331,6 +4342,7 @@ int main(int argc, char **argv, char **envp) if (display_type =3D=3D DT_DEFAULT && !display_remote) { #if defined(CONFIG_GTK) display_type =3D DT_GTK; + dpy.type =3D DISPLAY_TYPE_GTK; #elif defined(CONFIG_SDL) display_type =3D DT_SDL; #elif defined(CONFIG_COCOA) @@ -4339,6 +4351,7 @@ int main(int argc, char **argv, char **envp) vnc_parse("localhost:0,to=3D99,id=3Ddefault", &error_abort); #else display_type =3D DT_NONE; + dpy.type =3D DISPLAY_TYPE_NONE; #endif } =20 @@ -4352,7 +4365,7 @@ int main(int argc, char **argv, char **envp) } =20 if (display_type =3D=3D DT_GTK) { - early_gtk_display_init(request_opengl); + early_gtk_display_init(&dpy); } =20 if (display_type =3D=3D DT_SDL) { @@ -4697,7 +4710,7 @@ int main(int argc, char **argv, char **envp) cocoa_display_init(ds, full_screen); break; case DT_GTK: - gtk_display_init(ds, full_screen, grab_on_hover); + gtk_display_init(ds, &dpy); break; default: break; diff --git a/qapi/ui.json b/qapi/ui.json index 07b468f625..2a0772a53a 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -982,3 +982,62 @@ 'data': { '*device': 'str', '*head' : 'int', 'events' : [ 'InputEvent' ] } } + + +## +# @DisplayNoOpts: +# +# Empty struct for displays without config options. +# +# Since: 2.12 +# +## +{ 'struct' : 'DisplayNoOpts', + 'data' : { } } + +## +# @DisplayGTK: +# +# GTK display options. +# +# @grab-on-hover: Grab keyboard input on mouse hover. +# +# Since: 2.12 +# +## +{ 'struct' : 'DisplayGTK', + 'data' : { '*grab-on-hover' : 'bool' } } + +## +# @DisplayType: +# +# Display (user interface) type. +# +# Since: 2.12 +# +## +{ 'enum' : 'DisplayType', + 'data' : [ 'default', 'none', 'gtk' ] } + +## +# @DisplayOptions: +# +# Display (user interface) options. +# +# @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= ). +# @gl: Enable OpenGL support (default: off). +# +# Since: 2.12 +# +## +{ 'union' : 'DisplayOptions', + 'base' : { 'type' : 'DisplayType', + '*full-screen' : 'bool', + '*window-close' : 'bool', + '*gl' : 'bool' }, + 'discriminator' : 'type', + 'data' : { 'default' : 'DisplayNoOpts', + 'none' : 'DisplayNoOpts', + 'gtk' : 'DisplayGTK' } } --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243547740506.9290449332992; Mon, 29 Jan 2018 08:32:27 -0800 (PST) Received: from localhost ([::1]:48564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCLy-0005mU-Cm for importer@patchew.org; Mon, 29 Jan 2018 11:32:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEF-0007yv-14 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCED-0002T6-6r for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39926) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCEC-0002Rt-Ui for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42C9928209 for ; Mon, 29 Jan 2018 16:24:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id B871E5C25C; Mon, 29 Jan 2018 16:24:11 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 30D8117442; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:01 +0100 Message-Id: <20180129162408.415-6-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 29 Jan 2018 16:24:16 +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] [PATCH v2 05/12] sdl: use DisplayOptions 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: Paolo Bonzini , Gerd Hoffmann , Markus Armbruster 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" Switch sdl ui to use qapi DisplayOptions for configuration. Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 8 ++++---- ui/sdl.c | 19 +++++++++++++------ ui/sdl2.c | 33 +++++++++++++++++++-------------- vl.c | 13 +++++++++++-- qapi/ui.json | 5 +++-- 5 files changed, 50 insertions(+), 28 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 58d1a3d27c..deee5bb606 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -435,16 +435,16 @@ void surface_gl_setup_viewport(QemuGLShader *gls, =20 /* sdl.c */ #ifdef CONFIG_SDL -void sdl_display_early_init(int opengl); -void sdl_display_init(DisplayState *ds, int full_screen); +void sdl_display_early_init(DisplayOptions *opts); +void sdl_display_init(DisplayState *ds, DisplayOptions *opts); #else -static inline void sdl_display_early_init(int opengl) +static inline void sdl_display_early_init(DisplayOptions *opts) { /* This must never be called if CONFIG_SDL is disabled */ error_report("SDL support is disabled"); abort(); } -static inline void sdl_display_init(DisplayState *ds, int full_screen) +static inline void sdl_display_init(DisplayState *ds, DisplayOptions *opts) { /* This must never be called if CONFIG_SDL is disabled */ error_report("SDL support is disabled"); diff --git a/ui/sdl.c b/ui/sdl.c index c8f102bb9f..ca27e40299 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -41,6 +41,7 @@ =20 static DisplayChangeListener *dcl; static DisplaySurface *surface; +static DisplayOptions *opts; static SDL_Surface *real_screen; static SDL_Surface *guest_screen =3D NULL; static int gui_grab; /* if true, all keyboard/mouse events are grabbed */ @@ -762,6 +763,7 @@ static void handle_activation(SDL_Event *ev) static void sdl_refresh(DisplayChangeListener *dcl) { SDL_Event ev1, *ev =3D &ev1; + bool allow_close =3D true; int idle =3D 1; =20 if (last_vm_running !=3D runstate_is_running()) { @@ -786,7 +788,10 @@ static void sdl_refresh(DisplayChangeListener *dcl) handle_keyup(ev); break; case SDL_QUIT: - if (!no_quit) { + if (opts->has_window_close && !opts->window_close) { + allow_close =3D false; + } + if (allow_close) { no_shutdown =3D 0; qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); } @@ -885,9 +890,9 @@ static const DisplayChangeListenerOps dcl_ops =3D { .dpy_cursor_define =3D sdl_mouse_define, }; =20 -void sdl_display_early_init(int opengl) +void sdl_display_early_init(DisplayOptions *opts) { - if (opengl =3D=3D 1 /* on */) { + if (opts->has_gl && opts->gl) { fprintf(stderr, "SDL1 display code has no opengl support.\n" "Please recompile qemu with SDL2, using\n" @@ -895,7 +900,7 @@ void sdl_display_early_init(int opengl) } } =20 -void sdl_display_init(DisplayState *ds, int full_screen) +void sdl_display_init(DisplayState *ds, DisplayOptions *o) { int flags; uint8_t data =3D 0; @@ -903,6 +908,8 @@ void sdl_display_init(DisplayState *ds, int full_screen) SDL_SysWMinfo info; char *filename; =20 + assert(o->type =3D=3D DISPLAY_TYPE_SDL); + opts =3D o; #if defined(__APPLE__) /* always use generic keymaps */ if (!keyboard_layout) @@ -917,7 +924,7 @@ void sdl_display_init(DisplayState *ds, int full_screen) g_printerr("Running QEMU with SDL 1.2 is deprecated, and will be remov= ed\n" "in a future release. Please switch to SDL 2.0 instead\n"); =20 - if (!full_screen) { + if (opts->has_full_screen && opts->full_screen) { setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0); } #ifdef __linux__ @@ -960,7 +967,7 @@ void sdl_display_init(DisplayState *ds, int full_screen) g_free(filename); } =20 - if (full_screen) { + if (opts->has_full_screen && opts->full_screen) { gui_fullscreen =3D 1; sdl_grab_start(); } diff --git a/ui/sdl2.c b/ui/sdl2.c index 812c315891..094782e36c 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -32,6 +32,7 @@ =20 static int sdl2_num_outputs; static struct sdl2_console *sdl2_console; +static DisplayOptions *opts; =20 static SDL_Surface *guest_sprite_surface; static int gui_grab; /* if true, all keyboard/mouse events are grabbed */ @@ -525,6 +526,7 @@ static void handle_mousewheel(SDL_Event *ev) static void handle_windowevent(SDL_Event *ev) { struct sdl2_console *scon =3D get_scon_from_window(ev->window.windowID= ); + bool allow_close =3D true; =20 if (!scon) { return; @@ -571,7 +573,10 @@ static void handle_windowevent(SDL_Event *ev) break; case SDL_WINDOWEVENT_CLOSE: if (qemu_console_is_graphic(scon->dcl.con)) { - if (!no_quit) { + if (opts->has_window_close && !opts->window_close) { + allow_close =3D false; + } + if (allow_close) { no_shutdown =3D 0; qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); } @@ -592,6 +597,7 @@ static void handle_windowevent(SDL_Event *ev) void sdl2_poll_events(struct sdl2_console *scon) { SDL_Event ev1, *ev =3D &ev1; + bool allow_close =3D true; int idle =3D 1; =20 if (scon->last_vm_running !=3D runstate_is_running()) { @@ -614,7 +620,10 @@ void sdl2_poll_events(struct sdl2_console *scon) handle_textinput(ev); break; case SDL_QUIT: - if (!no_quit) { + if (opts->has_window_close && !opts->window_close) { + allow_close =3D false; + } + if (allow_close) { no_shutdown =3D 0; qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); } @@ -749,24 +758,17 @@ static const DisplayChangeListenerOps dcl_gl_ops =3D { }; #endif =20 -void sdl_display_early_init(int opengl) +void sdl_display_early_init(DisplayOptions *o) { - switch (opengl) { - case -1: /* default */ - case 0: /* off */ - break; - case 1: /* on */ + assert(o->type =3D=3D DISPLAY_TYPE_SDL); + if (o->has_gl && o->gl) { #ifdef CONFIG_OPENGL display_opengl =3D 1; #endif - break; - default: - g_assert_not_reached(); - break; } } =20 -void sdl_display_init(DisplayState *ds, int full_screen) +void sdl_display_init(DisplayState *ds, DisplayOptions *o) { int flags; uint8_t data =3D 0; @@ -774,6 +776,9 @@ void sdl_display_init(DisplayState *ds, int full_screen) int i; SDL_SysWMinfo info; =20 + assert(o->type =3D=3D DISPLAY_TYPE_SDL); + opts =3D o; + #ifdef __linux__ /* on Linux, SDL may use fbcon|directfb|svgalib when run without * accessible $DISPLAY to open X11 window. This is often the case @@ -848,7 +853,7 @@ void sdl_display_init(DisplayState *ds, int full_screen) g_free(filename); } =20 - if (full_screen) { + if (opts->has_full_screen && opts->full_screen) { gui_fullscreen =3D 1; sdl_grab_start(0); } diff --git a/vl.c b/vl.c index 4a555de0cf..25e784be63 100644 --- a/vl.c +++ b/vl.c @@ -2100,6 +2100,7 @@ static LegacyDisplayType select_display(const char *p) if (strstart(p, "sdl", &opts)) { #ifdef CONFIG_SDL display =3D DT_SDL; + dpy.type =3D DISPLAY_TYPE_SDL; while (*opts) { const char *nextopt; =20 @@ -2138,19 +2139,25 @@ static LegacyDisplayType select_display(const char = *p) } } else if (strstart(opts, ",window_close=3D", &nextopt)) { opts =3D nextopt; + dpy.has_window_close =3D true; if (strstart(opts, "on", &nextopt)) { no_quit =3D 0; + dpy.window_close =3D true; } else if (strstart(opts, "off", &nextopt)) { no_quit =3D 1; + dpy.window_close =3D false; } else { goto invalid_sdl_args; } } else if (strstart(opts, ",gl=3D", &nextopt)) { opts =3D nextopt; + dpy.has_gl =3D true; if (strstart(opts, "on", &nextopt)) { request_opengl =3D 1; + dpy.gl =3D true; } else if (strstart(opts, "off", &nextopt)) { request_opengl =3D 0; + dpy.gl =3D false; } else { goto invalid_sdl_args; } @@ -3679,6 +3686,7 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_sdl: #ifdef CONFIG_SDL display_type =3D DT_SDL; + dpy.type =3D DISPLAY_TYPE_SDL; break; #else error_report("SDL support is disabled"); @@ -4345,6 +4353,7 @@ int main(int argc, char **argv, char **envp) dpy.type =3D DISPLAY_TYPE_GTK; #elif defined(CONFIG_SDL) display_type =3D DT_SDL; + dpy.type =3D DISPLAY_TYPE_SDL; #elif defined(CONFIG_COCOA) display_type =3D DT_COCOA; #elif defined(CONFIG_VNC) @@ -4369,7 +4378,7 @@ int main(int argc, char **argv, char **envp) } =20 if (display_type =3D=3D DT_SDL) { - sdl_display_early_init(request_opengl); + sdl_display_early_init(&dpy); } =20 qemu_console_early_init(); @@ -4704,7 +4713,7 @@ int main(int argc, char **argv, char **envp) curses_display_init(ds, full_screen); break; case DT_SDL: - sdl_display_init(ds, full_screen); + sdl_display_init(ds, &dpy); break; case DT_COCOA: cocoa_display_init(ds, full_screen); diff --git a/qapi/ui.json b/qapi/ui.json index 2a0772a53a..9fbd2b0398 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1017,7 +1017,7 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'default', 'none', 'gtk' ] } + 'data' : [ 'default', 'none', 'gtk', 'sdl' ] } =20 ## # @DisplayOptions: @@ -1040,4 +1040,5 @@ 'discriminator' : 'type', 'data' : { 'default' : 'DisplayNoOpts', 'none' : 'DisplayNoOpts', - 'gtk' : 'DisplayGTK' } } + 'gtk' : 'DisplayGTK', + 'sdl' : 'DisplayNoOpts' } } --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243195515537.9236981512914; Mon, 29 Jan 2018 08:26:35 -0800 (PST) Received: from localhost ([::1]:48430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCGQ-0000yl-Mm for importer@patchew.org; Mon, 29 Jan 2018 11:26:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEE-0007yC-8T for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCED-0002TP-BO for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45948) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCED-0002S2-45 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -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 6430BC0568E3 for ; Mon, 29 Jan 2018 16:24:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC186608F1; Mon, 29 Jan 2018 16:24:11 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3910A17443; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:02 +0100 Message-Id: <20180129162408.415-7-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-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.32]); Mon, 29 Jan 2018 16:24:16 +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] [PATCH v2 06/12] vl: drop no_quit variable 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: Paolo Bonzini , 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" Not used any more, delete it. Signed-off-by: Gerd Hoffmann --- vl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/vl.c b/vl.c index 25e784be63..c17dedfa4e 100644 --- a/vl.c +++ b/vl.c @@ -152,7 +152,6 @@ int vga_interface_type =3D VGA_NONE; static int full_screen =3D 0; static DisplayOptions dpy; int no_frame; -int no_quit =3D 0; Chardev *serial_hds[MAX_SERIAL_PORTS]; Chardev *parallel_hds[MAX_PARALLEL_PORTS]; Chardev *virtcon_hds[MAX_VIRTIO_CONSOLES]; @@ -2141,10 +2140,8 @@ static LegacyDisplayType select_display(const char *= p) opts =3D nextopt; dpy.has_window_close =3D true; if (strstart(opts, "on", &nextopt)) { - no_quit =3D 0; dpy.window_close =3D true; } else if (strstart(opts, "off", &nextopt)) { - no_quit =3D 1; dpy.window_close =3D false; } else { goto invalid_sdl_args; @@ -3679,7 +3676,6 @@ int main(int argc, char **argv, char **envp) ctrl_grab =3D 1; break; case QEMU_OPTION_no_quit: - no_quit =3D 1; dpy.has_window_close =3D true; dpy.window_close =3D false; break; @@ -4368,7 +4364,8 @@ int main(int argc, char **argv, char **envp) error_report("-no-frame, -alt-grab and -ctrl-grab are only valid " "for SDL, ignoring option"); } - if (no_quit && (display_type !=3D DT_GTK && display_type !=3D DT_SDL))= { + if (dpy.has_window_close && + (display_type !=3D DT_GTK && display_type !=3D DT_SDL)) { error_report("-no-quit is only valid for GTK and SDL, " "ignoring option"); } --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243367566368.9984807225484; Mon, 29 Jan 2018 08:29:27 -0800 (PST) Received: from localhost ([::1]:48441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCJC-0003XL-LW for importer@patchew.org; Mon, 29 Jan 2018 11:29:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEE-0007y8-71 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCED-0002TK-AF for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35434) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCED-0002S6-4A for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -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 7878410F3DC for ; Mon, 29 Jan 2018 16:24:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0935608FA; Mon, 29 Jan 2018 16:24:11 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4461417444; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:03 +0100 Message-Id: <20180129162408.415-8-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-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.39]); Mon, 29 Jan 2018 16:24:16 +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] [PATCH v2 07/12] egl-headless: use DisplayOptions 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: Paolo Bonzini , Gerd Hoffmann , Markus Armbruster 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" Switch egl-headless ui to use qapi DisplayOptions for configuration. Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 2 +- ui/egl-headless.c | 2 +- vl.c | 3 ++- qapi/ui.json | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index deee5bb606..4cb623112e 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -530,6 +530,6 @@ static inline void early_gtk_display_init(DisplayOption= s *opts) #endif =20 /* egl-headless.c */ -void egl_headless_init(void); +void egl_headless_init(DisplayOptions *opts); =20 #endif diff --git a/ui/egl-headless.c b/ui/egl-headless.c index 5d50226869..38b3766548 100644 --- a/ui/egl-headless.c +++ b/ui/egl-headless.c @@ -154,7 +154,7 @@ static const DisplayChangeListenerOps egl_ops =3D { .dpy_gl_update =3D egl_scanout_flush, }; =20 -void egl_headless_init(void) +void egl_headless_init(DisplayOptions *opts) { QemuConsole *con; egl_dpy *edpy; diff --git a/vl.c b/vl.c index c17dedfa4e..1d801dd96d 100644 --- a/vl.c +++ b/vl.c @@ -2181,6 +2181,7 @@ static LegacyDisplayType select_display(const char *p) request_opengl =3D 1; display_opengl =3D 1; display =3D DT_EGL; + dpy.type =3D DISPLAY_TYPE_EGL_HEADLESS; #else fprintf(stderr, "egl support is disabled\n"); exit(1); @@ -4737,7 +4738,7 @@ int main(int argc, char **argv, char **envp) =20 #ifdef CONFIG_OPENGL_DMABUF if (display_type =3D=3D DT_EGL) { - egl_headless_init(); + egl_headless_init(&dpy); } #endif =20 diff --git a/qapi/ui.json b/qapi/ui.json index 9fbd2b0398..8f0ae1d76b 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1017,7 +1017,7 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'default', 'none', 'gtk', 'sdl' ] } + 'data' : [ 'default', 'none', 'gtk', 'sdl', 'egl-headless' ] } =20 ## # @DisplayOptions: @@ -1041,4 +1041,5 @@ 'data' : { 'default' : 'DisplayNoOpts', 'none' : 'DisplayNoOpts', 'gtk' : 'DisplayGTK', - 'sdl' : 'DisplayNoOpts' } } + 'sdl' : 'DisplayNoOpts', + 'egl-headless' : 'DisplayNoOpts' } } --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243685826323.4203971310312; Mon, 29 Jan 2018 08:34:45 -0800 (PST) Received: from localhost ([::1]:48768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCOL-0007iu-2p for importer@patchew.org; Mon, 29 Jan 2018 11:34:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEF-0007z6-6Y for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCED-0002U4-PN for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39438) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCED-0002Sq-Hx for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -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 DA4AA1752A8 for ; Mon, 29 Jan 2018 16:24:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6CD418AB5; Mon, 29 Jan 2018 16:24:12 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4F5C017445; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:04 +0100 Message-Id: <20180129162408.415-9-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-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.38]); Mon, 29 Jan 2018 16:24:16 +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] [PATCH v2 08/12] curses: use DisplayOptions 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: Paolo Bonzini , Gerd Hoffmann , Markus Armbruster 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" Switch curses ui to use qapi DisplayOptions for configuration. Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 4 ++-- ui/curses.c | 2 +- vl.c | 4 +++- qapi/ui.json | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 4cb623112e..9749503aa7 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -496,9 +496,9 @@ static inline int vnc_init_func(void *opaque, QemuOpts = *opts, Error **errp) =20 /* curses.c */ #ifdef CONFIG_CURSES -void curses_display_init(DisplayState *ds, int full_screen); +void curses_display_init(DisplayState *ds, DisplayOptions *opts); #else -static inline void curses_display_init(DisplayState *ds, int full_screen) +static inline void curses_display_init(DisplayState *ds, DisplayOptions *o= pts) { /* This must never be called if CONFIG_CURSES is disabled */ error_report("curses support is disabled"); diff --git a/ui/curses.c b/ui/curses.c index 85503876c0..479b77bd03 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -434,7 +434,7 @@ static const DisplayChangeListenerOps dcl_ops =3D { .dpy_text_cursor =3D curses_cursor_position, }; =20 -void curses_display_init(DisplayState *ds, int full_screen) +void curses_display_init(DisplayState *ds, DisplayOptions *opts) { #ifndef _WIN32 if (!isatty(1)) { diff --git a/vl.c b/vl.c index 1d801dd96d..6fa65c0dbd 100644 --- a/vl.c +++ b/vl.c @@ -2189,6 +2189,7 @@ static LegacyDisplayType select_display(const char *p) } else if (strstart(p, "curses", &opts)) { #ifdef CONFIG_CURSES display =3D DT_CURSES; + dpy.type =3D DISPLAY_TYPE_CURSES; #else error_report("curses support is disabled"); exit(1); @@ -3275,6 +3276,7 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_curses: #ifdef CONFIG_CURSES display_type =3D DT_CURSES; + dpy.type =3D DISPLAY_TYPE_CURSES; #else error_report("curses support is disabled"); exit(1); @@ -4708,7 +4710,7 @@ int main(int argc, char **argv, char **envp) /* init local displays */ switch (display_type) { case DT_CURSES: - curses_display_init(ds, full_screen); + curses_display_init(ds, &dpy); break; case DT_SDL: sdl_display_init(ds, &dpy); diff --git a/qapi/ui.json b/qapi/ui.json index 8f0ae1d76b..3fb0e78fbc 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1017,7 +1017,7 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'default', 'none', 'gtk', 'sdl', 'egl-headless' ] } + 'data' : [ 'default', 'none', 'gtk', 'sdl', 'egl-headless', 'curses' = ] } =20 ## # @DisplayOptions: @@ -1042,4 +1042,5 @@ 'none' : 'DisplayNoOpts', 'gtk' : 'DisplayGTK', 'sdl' : 'DisplayNoOpts', - 'egl-headless' : 'DisplayNoOpts' } } + 'egl-headless' : 'DisplayNoOpts', + 'curses' : 'DisplayNoOpts' } } --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243686407973.2017037654048; Mon, 29 Jan 2018 08:34:46 -0800 (PST) Received: from localhost ([::1]:48771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCOL-0007k9-Mz for importer@patchew.org; Mon, 29 Jan 2018 11:34:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCEF-0007yt-0g for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCED-0002Ts-N2 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33238) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCED-0002Sf-GH for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -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 C44C719CBCF; Mon, 29 Jan 2018 16:24:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98AAE18AC6; Mon, 29 Jan 2018 16:24:13 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5A6DA17446; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:05 +0100 Message-Id: <20180129162408.415-10-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-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.29]); Mon, 29 Jan 2018 16:24:16 +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] [PATCH v2 09/12] cocoa: use DisplayOptions 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: Peter Maydell , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster 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" Switch cocoa ui to use qapi DisplayOptions for configuration. Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 4 ++-- vl.c | 3 ++- qapi/ui.json | 6 ++++-- ui/cocoa.m | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 9749503aa7..f96fd907d0 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -454,9 +454,9 @@ static inline void sdl_display_init(DisplayState *ds, D= isplayOptions *opts) =20 /* cocoa.m */ #ifdef CONFIG_COCOA -void cocoa_display_init(DisplayState *ds, int full_screen); +void cocoa_display_init(DisplayState *ds, DisplayOptions *opts); #else -static inline void cocoa_display_init(DisplayState *ds, int full_screen) +static inline void cocoa_display_init(DisplayState *ds, DisplayOptions *op= ts) { /* This must never be called if CONFIG_COCOA is disabled */ error_report("Cocoa support is disabled"); diff --git a/vl.c b/vl.c index 6fa65c0dbd..eb8aca9479 100644 --- a/vl.c +++ b/vl.c @@ -4355,6 +4355,7 @@ int main(int argc, char **argv, char **envp) dpy.type =3D DISPLAY_TYPE_SDL; #elif defined(CONFIG_COCOA) display_type =3D DT_COCOA; + dpy.type =3D DISPLAY_TYPE_COCOA; #elif defined(CONFIG_VNC) vnc_parse("localhost:0,to=3D99,id=3Ddefault", &error_abort); #else @@ -4716,7 +4717,7 @@ int main(int argc, char **argv, char **envp) sdl_display_init(ds, &dpy); break; case DT_COCOA: - cocoa_display_init(ds, full_screen); + cocoa_display_init(ds, &dpy); break; case DT_GTK: gtk_display_init(ds, &dpy); diff --git a/qapi/ui.json b/qapi/ui.json index 3fb0e78fbc..08b89a01be 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1017,7 +1017,8 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'default', 'none', 'gtk', 'sdl', 'egl-headless', 'curses' = ] } + 'data' : [ 'default', 'none', 'gtk', 'sdl', + 'egl-headless', 'curses', 'cocoa' ] } =20 ## # @DisplayOptions: @@ -1043,4 +1044,5 @@ 'gtk' : 'DisplayGTK', 'sdl' : 'DisplayNoOpts', 'egl-headless' : 'DisplayNoOpts', - 'curses' : 'DisplayNoOpts' } } + 'curses' : 'DisplayNoOpts', + 'cocoa' : 'DisplayNoOpts' } } diff --git a/ui/cocoa.m b/ui/cocoa.m index 6be9848391..3e34d15716 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1682,12 +1682,12 @@ static void addRemovableDevicesMenuItems(void) qapi_free_BlockInfoList(pointerToFree); } =20 -void cocoa_display_init(DisplayState *ds, int full_screen) +void cocoa_display_init(DisplayState *ds, DisplayOptions *opts) { COCOA_DEBUG("qemu_cocoa: cocoa_display_init\n"); =20 /* if fullscreen mode is to be used */ - if (full_screen =3D=3D true) { + if (opts->has_full_screen && opts->full_screen) { [NSApp activateIgnoringOtherApps: YES]; [(QemuCocoaAppController *)[[NSApplication sharedApplication] dele= gate] toggleFullScreen: nil]; } --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243362913763.5392469294817; Mon, 29 Jan 2018 08:29:22 -0800 (PST) Received: from localhost ([::1]:48440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCJ8-0003TH-38 for importer@patchew.org; Mon, 29 Jan 2018 11:29:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCED-0007xx-V7 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCED-0002TB-73 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49830) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCED-0002S0-0l for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -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 54FFB39B26 for ; Mon, 29 Jan 2018 16:24:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C34060BF4; Mon, 29 Jan 2018 16:24:13 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 625D117447; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:06 +0100 Message-Id: <20180129162408.415-11-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-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.26]); Mon, 29 Jan 2018 16:24:16 +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] [PATCH v2 10/12] vl: drop full_screen variable 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: Paolo Bonzini , 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" Not used any more, delete it. Signed-off-by: Gerd Hoffmann --- vl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/vl.c b/vl.c index eb8aca9479..899fcad75e 100644 --- a/vl.c +++ b/vl.c @@ -149,7 +149,6 @@ static int rtc_utc =3D 1; static int rtc_date_offset =3D -1; /* -1 means no change */ QEMUClockType rtc_clock; int vga_interface_type =3D VGA_NONE; -static int full_screen =3D 0; static DisplayOptions dpy; int no_frame; Chardev *serial_hds[MAX_SERIAL_PORTS]; @@ -3659,7 +3658,6 @@ int main(int argc, char **argv, char **envp) loadvm =3D optarg; break; case QEMU_OPTION_full_screen: - full_screen =3D 1; dpy.has_full_screen =3D true; dpy.full_screen =3D true; break; --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243194242508.1613555575059; Mon, 29 Jan 2018 08:26:34 -0800 (PST) Received: from localhost ([::1]:48428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCGO-0000x7-CW for importer@patchew.org; Mon, 29 Jan 2018 11:26:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCED-0007xq-P5 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCEC-0002Rj-69 for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39892) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCEB-0002QU-UN for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:16 -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 mx1.redhat.com (Postfix) with ESMTPS id 457C228206 for ; Mon, 29 Jan 2018 16:24:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E38860C82; Mon, 29 Jan 2018 16:24:13 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6AB851744B; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:07 +0100 Message-Id: <20180129162408.415-12-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 29 Jan 2018 16:24:15 +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] [PATCH v2 11/12] vl: drop display_type variable 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: Paolo Bonzini , 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" Switch over all leftover users to qapi DisplayType. Then delete the unused display_type variable. Signed-off-by: Gerd Hoffmann --- vl.c | 54 ++++++++++++++---------------------------------------- 1 file changed, 14 insertions(+), 40 deletions(-) diff --git a/vl.c b/vl.c index 899fcad75e..827ab2a3b0 100644 --- a/vl.c +++ b/vl.c @@ -2080,24 +2080,12 @@ static void select_vgahw(const char *p) } } =20 -typedef enum LegacyDisplayType { - DT_DEFAULT, - DT_CURSES, - DT_SDL, - DT_COCOA, - DT_GTK, - DT_EGL, - DT_NONE, -} LegacyDisplayType; - -static LegacyDisplayType select_display(const char *p) +static void parse_display(const char *p) { const char *opts; - LegacyDisplayType display =3D DT_DEFAULT; =20 if (strstart(p, "sdl", &opts)) { #ifdef CONFIG_SDL - display =3D DT_SDL; dpy.type =3D DISPLAY_TYPE_SDL; while (*opts) { const char *nextopt; @@ -2179,7 +2167,6 @@ static LegacyDisplayType select_display(const char *p) #ifdef CONFIG_OPENGL_DMABUF request_opengl =3D 1; display_opengl =3D 1; - display =3D DT_EGL; dpy.type =3D DISPLAY_TYPE_EGL_HEADLESS; #else fprintf(stderr, "egl support is disabled\n"); @@ -2187,7 +2174,6 @@ static LegacyDisplayType select_display(const char *p) #endif } else if (strstart(p, "curses", &opts)) { #ifdef CONFIG_CURSES - display =3D DT_CURSES; dpy.type =3D DISPLAY_TYPE_CURSES; #else error_report("curses support is disabled"); @@ -2195,7 +2181,6 @@ static LegacyDisplayType select_display(const char *p) #endif } else if (strstart(p, "gtk", &opts)) { #ifdef CONFIG_GTK - display =3D DT_GTK; dpy.type =3D DISPLAY_TYPE_GTK; while (*opts) { const char *nextopt; @@ -2234,14 +2219,11 @@ static LegacyDisplayType select_display(const char = *p) exit(1); #endif } else if (strstart(p, "none", &opts)) { - display =3D DT_NONE; dpy.type =3D DISPLAY_TYPE_NONE; } else { error_report("unknown display type"); exit(1); } - - return display; } =20 static int balloon_parse(const char *arg) @@ -3069,7 +3051,6 @@ int main(int argc, char **argv, char **envp) const char *incoming =3D NULL; bool userconfig =3D true; bool nographic =3D false; - LegacyDisplayType display_type =3D DT_DEFAULT; int display_remote =3D 0; const char *log_mask =3D NULL; const char *log_file =3D NULL; @@ -3263,18 +3244,16 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_display: - display_type =3D select_display(optarg); + parse_display(optarg); break; case QEMU_OPTION_nographic: olist =3D qemu_find_opts("machine"); qemu_opts_parse_noisily(olist, "graphics=3Doff", false); nographic =3D true; - display_type =3D DT_NONE; dpy.type =3D DISPLAY_TYPE_NONE; break; case QEMU_OPTION_curses: #ifdef CONFIG_CURSES - display_type =3D DT_CURSES; dpy.type =3D DISPLAY_TYPE_CURSES; #else error_report("curses support is disabled"); @@ -3682,7 +3661,6 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_sdl: #ifdef CONFIG_SDL - display_type =3D DT_SDL; dpy.type =3D DISPLAY_TYPE_SDL; break; #else @@ -4298,7 +4276,7 @@ int main(int argc, char **argv, char **envp) exit(1); } #ifdef CONFIG_CURSES - if (display_type =3D=3D DT_CURSES) { + if (dpy.type =3D=3D DISPLAY_TYPE_CURSES) { error_report("curses display cannot be used with -daemonize"); exit(1); } @@ -4344,39 +4322,35 @@ int main(int argc, char **argv, char **envp) display_remote++; } #endif - if (display_type =3D=3D DT_DEFAULT && !display_remote) { + if (dpy.type =3D=3D DISPLAY_TYPE_DEFAULT && !display_remote) { #if defined(CONFIG_GTK) - display_type =3D DT_GTK; dpy.type =3D DISPLAY_TYPE_GTK; #elif defined(CONFIG_SDL) - display_type =3D DT_SDL; dpy.type =3D DISPLAY_TYPE_SDL; #elif defined(CONFIG_COCOA) - display_type =3D DT_COCOA; dpy.type =3D DISPLAY_TYPE_COCOA; #elif defined(CONFIG_VNC) vnc_parse("localhost:0,to=3D99,id=3Ddefault", &error_abort); #else - display_type =3D DT_NONE; dpy.type =3D DISPLAY_TYPE_NONE; #endif } =20 - if ((no_frame || alt_grab || ctrl_grab) && display_type !=3D DT_SDL) { + if ((no_frame || alt_grab || ctrl_grab) && dpy.type !=3D DISPLAY_TYPE_= SDL) { error_report("-no-frame, -alt-grab and -ctrl-grab are only valid " "for SDL, ignoring option"); } if (dpy.has_window_close && - (display_type !=3D DT_GTK && display_type !=3D DT_SDL)) { + (dpy.type !=3D DISPLAY_TYPE_GTK && dpy.type !=3D DISPLAY_TYPE_SDL)= ) { error_report("-no-quit is only valid for GTK and SDL, " "ignoring option"); } =20 - if (display_type =3D=3D DT_GTK) { + if (dpy.type =3D=3D DISPLAY_TYPE_GTK) { early_gtk_display_init(&dpy); } =20 - if (display_type =3D=3D DT_SDL) { + if (dpy.type =3D=3D DISPLAY_TYPE_SDL) { sdl_display_early_init(&dpy); } =20 @@ -4707,17 +4681,17 @@ int main(int argc, char **argv, char **envp) ds =3D init_displaystate(); =20 /* init local displays */ - switch (display_type) { - case DT_CURSES: + switch (dpy.type) { + case DISPLAY_TYPE_CURSES: curses_display_init(ds, &dpy); break; - case DT_SDL: + case DISPLAY_TYPE_SDL: sdl_display_init(ds, &dpy); break; - case DT_COCOA: + case DISPLAY_TYPE_COCOA: cocoa_display_init(ds, &dpy); break; - case DT_GTK: + case DISPLAY_TYPE_GTK: gtk_display_init(ds, &dpy); break; default: @@ -4738,7 +4712,7 @@ int main(int argc, char **argv, char **envp) } =20 #ifdef CONFIG_OPENGL_DMABUF - if (display_type =3D=3D DT_EGL) { + if (dpy.type =3D=3D DISPLAY_TYPE_EGL_HEADLESS) { egl_headless_init(&dpy); } #endif --=20 2.9.3 From nobody Sat Apr 27 07:18:22 2024 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 1517243196989876.6550859950103; Mon, 29 Jan 2018 08:26:36 -0800 (PST) Received: from localhost ([::1]:48429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCGO-0000xT-Bb for importer@patchew.org; Mon, 29 Jan 2018 11:26:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egCED-0007xw-Us for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egCEC-0002SM-PP for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39922) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egCEC-0002RV-Ii for qemu-devel@nongnu.org; Mon, 29 Jan 2018 11:24:16 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D734A28219 for ; Mon, 29 Jan 2018 16:24:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9F7B5C54F; Mon, 29 Jan 2018 16:24:13 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 72B3B1744C; Mon, 29 Jan 2018 17:24:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Jan 2018 17:24:08 +0100 Message-Id: <20180129162408.415-13-kraxel@redhat.com> In-Reply-To: <20180129162408.415-1-kraxel@redhat.com> References: <20180129162408.415-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 29 Jan 2018 16:24:15 +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] [PATCH v2 12/12] vl: drop request_opengl variable 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: Paolo Bonzini , 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" Switch over the one leftover user to qapi DisplayType. The delete the unused request_opengl variable. Signed-off-by: Gerd Hoffmann --- vl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/vl.c b/vl.c index 827ab2a3b0..42867d60f8 100644 --- a/vl.c +++ b/vl.c @@ -135,7 +135,6 @@ static const char *data_dir[16]; static int data_dir_idx; const char *bios_name =3D NULL; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; -int request_opengl =3D -1; int display_opengl; const char* keyboard_layout =3D NULL; ram_addr_t ram_size; @@ -2137,10 +2136,8 @@ static void parse_display(const char *p) opts =3D nextopt; dpy.has_gl =3D true; if (strstart(opts, "on", &nextopt)) { - request_opengl =3D 1; dpy.gl =3D true; } else if (strstart(opts, "off", &nextopt)) { - request_opengl =3D 0; dpy.gl =3D false; } else { goto invalid_sdl_args; @@ -2165,7 +2162,6 @@ static void parse_display(const char *p) } } else if (strstart(p, "egl-headless", &opts)) { #ifdef CONFIG_OPENGL_DMABUF - request_opengl =3D 1; display_opengl =3D 1; dpy.type =3D DISPLAY_TYPE_EGL_HEADLESS; #else @@ -2199,10 +2195,8 @@ static void parse_display(const char *p) opts =3D nextopt; dpy.has_gl =3D true; if (strstart(opts, "on", &nextopt)) { - request_opengl =3D 1; dpy.gl =3D true; } else if (strstart(opts, "off", &nextopt)) { - request_opengl =3D 0; dpy.gl =3D false; } else { goto invalid_gtk_args; @@ -4356,7 +4350,7 @@ int main(int argc, char **argv, char **envp) =20 qemu_console_early_init(); =20 - if (request_opengl =3D=3D 1 && display_opengl =3D=3D 0) { + if (dpy.has_gl && dpy.gl && display_opengl =3D=3D 0) { #if defined(CONFIG_OPENGL) error_report("OpenGL is not supported by the display"); #else --=20 2.9.3