From nobody Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519134879058667.7750717093611; Tue, 20 Feb 2018 05:54:39 -0800 (PST) Received: from localhost ([::1]:55658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8NS-0001pP-AY for importer@patchew.org; Tue, 20 Feb 2018 08:54:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gk-0005HF-5f for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Gj-00073A-5t for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:42 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33170 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Gj-00072j-0l for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:41 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7CB22402813F for ; Tue, 20 Feb 2018 13:47:30 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B6BB10B0F44; Tue, 20 Feb 2018 13:47:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B629117514; Tue, 20 Feb 2018 14:47:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:12 +0100 Message-Id: <20180220134723.11776-2-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 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 Message-id: 20180202111022.19269-2-kraxel@redhat.com 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 81724f5f17..c1f763f3e1 100644 --- a/vl.c +++ b/vl.c @@ -2105,6 +2105,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; @@ -3639,6 +3641,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 56388b5b33..8e3556976b 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2741,6 +2741,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 Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519135026977740.0866417807606; Tue, 20 Feb 2018 05:57:06 -0800 (PST) Received: from localhost ([::1]:55671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Pq-0003zj-0f for importer@patchew.org; Tue, 20 Feb 2018 08:57:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gj-0005H8-FC for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Gi-00072O-JD for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:41 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60460 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Gi-00071n-Ec for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:40 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A451240FB646 for ; Tue, 20 Feb 2018 13:47:28 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BB752026E0E; Tue, 20 Feb 2018 13:47:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BEDBC17515; Tue, 20 Feb 2018 14:47:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:13 +0100 Message-Id: <20180220134723.11776-3-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 02/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 Reviewed-by: Eric Blake Message-id: 20180202111022.19269-4-kraxel@redhat.com Signed-off-by: Gerd Hoffmann --- vl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vl.c b/vl.c index c1f763f3e1..746e2c169c 100644 --- a/vl.c +++ b/vl.c @@ -2083,7 +2083,7 @@ static void select_vgahw(const char *p) } } =20 -typedef enum DisplayType { +typedef enum LegacyDisplayType { DT_DEFAULT, DT_CURSES, DT_SDL, @@ -2091,12 +2091,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 @@ -3051,7 +3051,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 Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519135033233978.0722076808039; Tue, 20 Feb 2018 05:57:13 -0800 (PST) Received: from localhost ([::1]:55673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Pv-00043l-TK for importer@patchew.org; Tue, 20 Feb 2018 08:57:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gn-0005Jh-8r for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Gi-00072d-LS for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:45 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33824 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Gi-00071p-F3 for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:40 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2723AEB705 for ; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E01A2166BB6; Tue, 20 Feb 2018 13:47:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CA7751751D; Tue, 20 Feb 2018 14:47:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:14 +0100 Message-Id: <20180220134723.11776-4-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 03/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 Reviewed-by: Eric Blake Message-id: 20180202111022.19269-5-kraxel@redhat.com Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 9 ++++---- ui/gtk.c | 32 ++++++++++++++++------------- vl.c | 23 ++++++++++++++++----- qapi/ui.json | 58 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 98 insertions(+), 24 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 12fef80923..82cb000e3b 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -486,18 +486,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 1537751afa..ad4910c70d 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -230,6 +230,8 @@ struct GtkDisplayState { =20 bool modifier_pressed[ARRAY_SIZE(modifier_keycode)]; bool ignore_keys; + + DisplayOptions *opts; }; =20 typedef struct VCChardev { @@ -778,9 +780,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; @@ -2290,7 +2297,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 @@ -2302,6 +2309,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" @@ -2388,15 +2397,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 @@ -2422,11 +2433,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(); @@ -2434,10 +2442,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 746e2c169c..a82b7cf16f 100644 --- a/vl.c +++ b/vl.c @@ -151,9 +151,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]; @@ -2188,24 +2188,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; } @@ -2222,6 +2227,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); @@ -3252,6 +3258,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 @@ -3639,6 +3646,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" @@ -3653,6 +3662,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 @@ -4320,6 +4331,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) @@ -4328,6 +4340,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 @@ -4341,7 +4354,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) { @@ -4686,7 +4699,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 d6679aa8f5..878a3bd2a6 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -985,3 +985,61 @@ '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' : [ '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' : { 'none' : 'DisplayNoOpts', + 'gtk' : 'DisplayGTK' } } --=20 2.9.3 From nobody Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519135030079583.1280506522183; Tue, 20 Feb 2018 05:57:10 -0800 (PST) Received: from localhost ([::1]:55672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Pt-00041M-3h for importer@patchew.org; Tue, 20 Feb 2018 08:57:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gt-0005NF-Gi for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Gi-00072W-Ji for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:50 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36256 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Gi-00071o-E5 for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:40 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 48DFE80401C1 for ; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87484202699A; Tue, 20 Feb 2018 13:47:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D71141751E; Tue, 20 Feb 2018 14:47:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:15 +0100 Message-Id: <20180220134723.11776-5-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 04/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 Reviewed-by: Eric Blake Message-id: 20180202111022.19269-6-kraxel@redhat.com 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 82cb000e3b..4e4d027936 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -431,16 +431,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 a6bff301eb..963cdf77a7 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 */ @@ -769,6 +770,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()) { @@ -793,7 +795,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); } @@ -892,9 +897,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" @@ -902,7 +907,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; @@ -910,6 +915,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) @@ -924,7 +931,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__ @@ -967,7 +974,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 858e04d7c0..6e96a4a24c 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 */ @@ -526,6 +527,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; @@ -572,7 +574,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); } @@ -593,6 +598,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()) { @@ -615,7 +621,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); } @@ -750,24 +759,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; @@ -775,6 +777,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 @@ -849,7 +854,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 a82b7cf16f..61b72758a8 100644 --- a/vl.c +++ b/vl.c @@ -2101,6 +2101,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 @@ -2135,19 +2136,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; } @@ -3668,6 +3675,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"); @@ -4334,6 +4342,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) @@ -4358,7 +4367,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(); @@ -4693,7 +4702,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 878a3bd2a6..2efe9675b7 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1020,7 +1020,7 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'none', 'gtk' ] } + 'data' : [ 'none', 'gtk', 'sdl' ] } =20 ## # @DisplayOptions: @@ -1042,4 +1042,5 @@ '*gl' : 'bool' }, 'discriminator' : 'type', 'data' : { 'none' : 'DisplayNoOpts', - 'gtk' : 'DisplayGTK' } } + 'gtk' : 'DisplayGTK', + 'sdl' : 'DisplayNoOpts' } } --=20 2.9.3 From nobody Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519134571750532.4976516862062; Tue, 20 Feb 2018 05:49:31 -0800 (PST) Received: from localhost ([::1]:55629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8IV-0006Gi-1p for importer@patchew.org; Tue, 20 Feb 2018 08:49:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gh-0005Ge-Fw for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Ge-0006yf-LV for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:39 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33168 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Ge-0006xi-Gf for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:36 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EC4A4015177 for ; Tue, 20 Feb 2018 13:47:36 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 020E0AB588; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DF6B817528; Tue, 20 Feb 2018 14:47:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:16 +0100 Message-Id: <20180220134723.11776-6-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 20 Feb 2018 13:47:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 20 Feb 2018 13:47:36 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 05/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 Message-id: 20180202111022.19269-7-kraxel@redhat.com Signed-off-by: Gerd Hoffmann --- vl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/vl.c b/vl.c index 61b72758a8..f52bc3b879 100644 --- a/vl.c +++ b/vl.c @@ -153,7 +153,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]; @@ -2138,10 +2137,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; @@ -3668,7 +3665,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; @@ -4357,7 +4353,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 Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15191348783751010.0875559629753; Tue, 20 Feb 2018 05:54:38 -0800 (PST) Received: from localhost ([::1]:55656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8NM-0001jX-He for importer@patchew.org; Tue, 20 Feb 2018 08:54:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gi-0005Gj-9c for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Ge-0006yG-EP for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:40 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33822 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Ge-0006xI-7y for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:36 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FC2CEB70A for ; Tue, 20 Feb 2018 13:47:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3006A10A9DC5; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EAF1717533; Tue, 20 Feb 2018 14:47:23 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:17 +0100 Message-Id: <20180220134723.11776-7-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 20 Feb 2018 13:47:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 20 Feb 2018 13:47:31 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 06/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 Reviewed-by: Eric Blake Message-id: 20180202111022.19269-8-kraxel@redhat.com 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 4e4d027936..183d9f2913 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -505,6 +505,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 f52bc3b879..38c18ef2e6 100644 --- a/vl.c +++ b/vl.c @@ -2178,6 +2178,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 error_report("egl support is disabled"); exit(1); @@ -4726,7 +4727,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 2efe9675b7..43de75fa27 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1020,7 +1020,7 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'none', 'gtk', 'sdl' ] } + 'data' : [ 'none', 'gtk', 'sdl', 'egl-headless' ] } =20 ## # @DisplayOptions: @@ -1043,4 +1043,5 @@ 'discriminator' : 'type', 'data' : { 'none' : 'DisplayNoOpts', 'gtk' : 'DisplayGTK', - 'sdl' : 'DisplayNoOpts' } } + 'sdl' : 'DisplayNoOpts', + 'egl-headless' : 'DisplayNoOpts' } } --=20 2.9.3 From nobody Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519134717386248.81754131422952; Tue, 20 Feb 2018 05:51:57 -0800 (PST) Received: from localhost ([::1]:55643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Kq-0008CN-Jn for importer@patchew.org; Tue, 20 Feb 2018 08:51:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gh-0005Gg-Gl for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Ge-0006yl-MD for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:39 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36254 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Ge-0006xm-Gn for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:36 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E91380D2EC8 for ; Tue, 20 Feb 2018 13:47:36 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3013EAB5A3; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0209717534; Tue, 20 Feb 2018 14:47:24 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:18 +0100 Message-Id: <20180220134723.11776-8-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 20 Feb 2018 13:47:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 20 Feb 2018 13:47:36 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 07/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 Reviewed-by: Eric Blake Message-id: 20180202111022.19269-9-kraxel@redhat.com 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 183d9f2913..65ed6ddca6 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -471,9 +471,9 @@ 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 38c18ef2e6..3752ebec49 100644 --- a/vl.c +++ b/vl.c @@ -2186,6 +2186,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); @@ -3268,6 +3269,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); @@ -4697,7 +4699,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 43de75fa27..11aad8b496 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1020,7 +1020,7 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'none', 'gtk', 'sdl', 'egl-headless' ] } + 'data' : [ 'none', 'gtk', 'sdl', 'egl-headless', 'curses' ] } =20 ## # @DisplayOptions: @@ -1044,4 +1044,5 @@ 'data' : { 'none' : 'DisplayNoOpts', 'gtk' : 'DisplayGTK', 'sdl' : 'DisplayNoOpts', - 'egl-headless' : 'DisplayNoOpts' } } + 'egl-headless' : 'DisplayNoOpts', + 'curses' : 'DisplayNoOpts' } } --=20 2.9.3 From nobody Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519134720462502.2098463685526; Tue, 20 Feb 2018 05:52:00 -0800 (PST) Received: from localhost ([::1]:55644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Ks-0008Dv-O4 for importer@patchew.org; Tue, 20 Feb 2018 08:51:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gh-0005Gh-HB for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Ge-0006y8-D2 for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:39 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60458 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Ge-0006xG-7h for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:36 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9515D40FB650; Tue, 20 Feb 2018 13:47:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93D35217B400; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0D6A317535; Tue, 20 Feb 2018 14:47:24 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:19 +0100 Message-Id: <20180220134723.11776-9-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 20 Feb 2018 13:47:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 20 Feb 2018 13:47:31 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 08/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 Reviewed-by: Eric Blake Message-id: 20180202111022.19269-10-kraxel@redhat.com 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 65ed6ddca6..e6b1227bef 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -450,9 +450,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 3752ebec49..2dd00e00d9 100644 --- a/vl.c +++ b/vl.c @@ -4344,6 +4344,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 @@ -4705,7 +4706,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 11aad8b496..398baa9698 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1020,7 +1020,8 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'none', 'gtk', 'sdl', 'egl-headless', 'curses' ] } + 'data' : [ 'none', 'gtk', 'sdl', + 'egl-headless', 'curses', 'cocoa' ] } =20 ## # @DisplayOptions: @@ -1045,4 +1046,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 51db47cd71..90d9aa57ea 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1683,12 +1683,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 Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519134574266705.4329477026864; Tue, 20 Feb 2018 05:49:34 -0800 (PST) Received: from localhost ([::1]:55630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8IV-0006Gt-Af for importer@patchew.org; Tue, 20 Feb 2018 08:49:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gh-0005Gf-GP for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Ge-0006yL-EK for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:39 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33164 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Ge-0006xH-8B for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:36 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62DBC4028150 for ; Tue, 20 Feb 2018 13:47:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 301C32024CA6; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 15A8A17536; Tue, 20 Feb 2018 14:47:24 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:20 +0100 Message-Id: <20180220134723.11776-10-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 20 Feb 2018 13:47:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 20 Feb 2018 13:47:31 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 09/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 Reviewed-by: Eric Blake Message-id: 20180202111022.19269-11-kraxel@redhat.com Signed-off-by: Gerd Hoffmann --- vl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/vl.c b/vl.c index 2dd00e00d9..6271ad0634 100644 --- a/vl.c +++ b/vl.c @@ -150,7 +150,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]; @@ -3652,7 +3651,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 Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519134725600915.6435412547174; Tue, 20 Feb 2018 05:52:05 -0800 (PST) Received: from localhost ([::1]:55645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Kv-0008Em-QK for importer@patchew.org; Tue, 20 Feb 2018 08:52:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gj-0005H5-EC for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Ge-0006y6-Cu for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:41 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36252 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Ge-0006xK-88 for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:36 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7279D8182D3E for ; Tue, 20 Feb 2018 13:47:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 309CA2156A3F; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1DEBA17537; Tue, 20 Feb 2018 14:47:24 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:21 +0100 Message-Id: <20180220134723.11776-11-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 20 Feb 2018 13:47:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 20 Feb 2018 13:47:31 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 10/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 Reviewed-by: Eric Blake Message-id: 20180202111022.19269-12-kraxel@redhat.com Signed-off-by: Gerd Hoffmann --- vl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/vl.c b/vl.c index 6271ad0634..11dc98eba2 100644 --- a/vl.c +++ b/vl.c @@ -136,7 +136,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; @@ -2146,10 +2145,8 @@ static LegacyDisplayType select_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; @@ -2174,7 +2171,6 @@ static LegacyDisplayType select_display(const char *p) } } else if (strstart(p, "egl-headless", &opts)) { #ifdef CONFIG_OPENGL_DMABUF - request_opengl =3D 1; display_opengl =3D 1; display =3D DT_EGL; dpy.type =3D DISPLAY_TYPE_EGL_HEADLESS; @@ -2211,10 +2207,8 @@ static LegacyDisplayType select_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; @@ -4371,7 +4365,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 From nobody Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519134574269265.081805537013; Tue, 20 Feb 2018 05:49:34 -0800 (PST) Received: from localhost ([::1]:55631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8IW-0006Hq-EK for importer@patchew.org; Tue, 20 Feb 2018 08:49:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gh-0005Gi-HN for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Ge-0006yM-E7 for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:39 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33166 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Ge-0006xJ-8C for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:36 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B2FE4028152 for ; Tue, 20 Feb 2018 13:47:32 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id D54832024CA6; Tue, 20 Feb 2018 13:47:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 277E317538; Tue, 20 Feb 2018 14:47:24 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:22 +0100 Message-Id: <20180220134723.11776-12-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 20 Feb 2018 13:47:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 20 Feb 2018 13:47:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 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 , 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 over all leftover users to qapi DisplayType. Then delete the unused display_type variable. Add 'default' DisplayType, which isn't an actual display type but a placeholder for "user didn't specify a display". It will be replaced by the DisplayType actually used, which in turn depends on the DisplayTypes availabel in the particular build. Signed-off-by: Gerd Hoffmann Reviewed-by: Eric Blake Message-id: 20180202111022.19269-13-kraxel@redhat.com Signed-off-by: Gerd Hoffmann --- vl.c | 54 ++++++++++++++---------------------------------------- qapi/ui.json | 5 +++-- 2 files changed, 17 insertions(+), 42 deletions(-) diff --git a/vl.c b/vl.c index 11dc98eba2..9e7235df6d 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; @@ -2172,7 +2160,6 @@ static LegacyDisplayType select_display(const char *p) } else if (strstart(p, "egl-headless", &opts)) { #ifdef CONFIG_OPENGL_DMABUF display_opengl =3D 1; - display =3D DT_EGL; dpy.type =3D DISPLAY_TYPE_EGL_HEADLESS; #else error_report("egl support is disabled"); @@ -2180,7 +2167,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"); @@ -2188,7 +2174,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; @@ -2225,14 +2210,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) @@ -3056,7 +3038,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; @@ -3250,18 +3231,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"); @@ -3665,7 +3644,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 @@ -4281,7 +4259,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); } @@ -4327,39 +4305,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 @@ -4690,17 +4664,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: @@ -4721,7 +4695,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 diff --git a/qapi/ui.json b/qapi/ui.json index 398baa9698..3e82f25ac5 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1020,7 +1020,7 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'none', 'gtk', 'sdl', + 'data' : [ 'default', 'none', 'gtk', 'sdl', 'egl-headless', 'curses', 'cocoa' ] } =20 ## @@ -1042,7 +1042,8 @@ '*window-close' : 'bool', '*gl' : 'bool' }, 'discriminator' : 'type', - 'data' : { 'none' : 'DisplayNoOpts', + 'data' : { 'default' : 'DisplayNoOpts', + 'none' : 'DisplayNoOpts', 'gtk' : 'DisplayGTK', 'sdl' : 'DisplayNoOpts', 'egl-headless' : 'DisplayNoOpts', --=20 2.9.3 From nobody Fri Oct 24 09:58:55 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151913515500259.64243882954759; Tue, 20 Feb 2018 05:59:15 -0800 (PST) Received: from localhost ([::1]:55687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Rq-0005gc-NG for importer@patchew.org; Tue, 20 Feb 2018 08:59:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo8Gk-0005HH-5c for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo8Gj-00073I-73 for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:42 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33828 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo8Gj-00072o-0P for qemu-devel@nongnu.org; Tue, 20 Feb 2018 08:47:41 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 866EBEB709; Tue, 20 Feb 2018 13:47:30 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D3BC10B0F47; Tue, 20 Feb 2018 13:47:30 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2FDBA17539; Tue, 20 Feb 2018 14:47:24 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 14:47:23 +0100 Message-Id: <20180220134723.11776-13-kraxel@redhat.com> In-Reply-To: <20180220134723.11776-1-kraxel@redhat.com> References: <20180220134723.11776-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 20 Feb 2018 13:47:30 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 12/12] ui: Reorder vte terminal packing to avoid gtk3 warnings 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: Jan Kiszka , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jan Kiszka Fill the terminal box from right to left to avoid Gtk-WARNING **: Allocating size to GtkScrollbar 0x55f6d54b0200 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? Signed-off-by: Jan Kiszka Message-id: 902aaef8-d20e-0530-dea2-cdfe3db33ff3@web.de Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index ad4910c70d..ab646b70e1 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1952,8 +1952,8 @@ static GSList *gd_vc_vte_init(GtkDisplayState *s, Vir= tualConsole *vc, scrollbar =3D gtk_vscrollbar_new(vadjustment); #endif =20 - gtk_box_pack_start(GTK_BOX(box), vc->vte.terminal, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(box), scrollbar, FALSE, FALSE, 0); + gtk_box_pack_end(GTK_BOX(box), scrollbar, FALSE, FALSE, 0); + gtk_box_pack_end(GTK_BOX(box), vc->vte.terminal, TRUE, TRUE, 0); =20 vc->vte.box =3D box; vc->vte.scrollbar =3D scrollbar; --=20 2.9.3