From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1no6-0002gl-9A for qemu-devel@nongnu.org; Sun, 26 Feb 2012 18:47:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1no4-0007A6-F2 for qemu-devel@nongnu.org; Sun, 26 Feb 2012 18:47:10 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:37515 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1no4-00079x-8X for qemu-devel@nongnu.org; Sun, 26 Feb 2012 18:47:08 -0500 From: Anthony Liguori Date: Sun, 26 Feb 2012 17:46:35 -0600 Message-Id: <1330299995-8688-9-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1330299995-8688-1-git-send-email-aliguori@us.ibm.com> References: <1330299995-8688-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 8/8] gtk: make default UI List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Weil , Anthony Liguori , Alex Graf , Paolo Bonzini A user can still enable SDL with '-sdl' or '-display sdl' but start making the default display GTK by default. I'd also like to deprecate the SDL display and remove it in a few releases. Signed-off-by: Anthony Liguori --- vl.c | 38 ++++++++++++++++++++++++-------------- 1 files changed, 24 insertions(+), 14 deletions(-) diff --git a/vl.c b/vl.c index 1d4c350..95d4e79 100644 --- a/vl.c +++ b/vl.c @@ -3290,6 +3290,25 @@ int main(int argc, char **argv, char **envp) add_device_config(DEV_VIRTCON, "vc:80Cx24C"); } + if (display_type == DT_DEFAULT) { +#if defined(CONFIG_GTK) + display_type = DT_GTK; +#elif defined(CONFIG_SDL) || defined(CONFIG_COCOA) + display_type = DT_SDL; +#elif defined(CONFIG_VNC) + vnc_display = "localhost:0,to=99"; + show_vnc_port = 1; +#else + display_type = DT_NONE; +#endif + } + +#if defined(CONFIG_GTK) + if (display_type == DT_GTK) { + early_gtk_display_init(); + } +#endif + socket_init(); if (qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, 1) != 0) @@ -3502,20 +3521,6 @@ int main(int argc, char **argv, char **envp) /* just use the first displaystate for the moment */ ds = get_displaystate(); - if (using_spice) - display_remote++; - if (display_type == DT_DEFAULT && !display_remote) { -#if defined(CONFIG_SDL) || defined(CONFIG_COCOA) - display_type = DT_SDL; -#elif defined(CONFIG_VNC) - vnc_display = "localhost:0,to=99"; - show_vnc_port = 1; -#else - display_type = DT_NONE; -#endif - } - - /* init local displays */ switch (display_type) { case DT_NOGRAPHIC: @@ -3534,6 +3539,11 @@ int main(int argc, char **argv, char **envp) cocoa_display_init(ds, full_screen); break; #endif +#if defined(CONFIG_GTK) + case DT_GTK: + gtk_display_init(ds); + break; +#endif default: break; } -- 1.7.4.1