From patchwork Mon Feb 18 23:57:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 221590 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4CB872C008D for ; Tue, 19 Feb 2013 11:29:30 +1100 (EST) Received: from localhost ([::1]:40333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7ab4-0006yi-Is for incoming@patchwork.ozlabs.org; Mon, 18 Feb 2013 18:58:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7aad-0005ug-2U for qemu-devel@nongnu.org; Mon, 18 Feb 2013 18:57:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7aab-0003bS-Om for qemu-devel@nongnu.org; Mon, 18 Feb 2013 18:57:42 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:58998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7aab-0003ah-8Q for qemu-devel@nongnu.org; Mon, 18 Feb 2013 18:57:41 -0500 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Feb 2013 05:24:54 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 19 Feb 2013 05:24:51 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 64601E004C for ; Tue, 19 Feb 2013 05:28:33 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1INvY7e25624828 for ; Tue, 19 Feb 2013 05:27:34 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1INvaXK014581 for ; Tue, 19 Feb 2013 10:57:36 +1100 Received: from titi.austin.rr.com (sig-9-49-157-221.mts.ibm.com [9.49.157.221]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r1INv8Ew013654; Tue, 19 Feb 2013 10:57:34 +1100 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2013 17:57:04 -0600 Message-Id: <1361231825-12037-9-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1361231825-12037-1-git-send-email-aliguori@us.ibm.com> References: <1361231825-12037-1-git-send-email-aliguori@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13021823-8878-0000-0000-000005F13CAE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.7 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH 8/9] gtk: make default UI (v3) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- v1 -> v3: - fix -display gtk - fix -vnc none --- vl.c | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/vl.c b/vl.c index c5b0eea..d0fec59 100644 --- a/vl.c +++ b/vl.c @@ -2206,6 +2206,13 @@ static DisplayType select_display(const char *p) fprintf(stderr, "Curses support is disabled\n"); exit(1); #endif + } else if (strstart(p, "gtk", &opts)) { +#ifdef CONFIG_GTK + display = DT_GTK; +#else + fprintf(stderr, "GTK support is disabled\n"); + exit(1); +#endif } else if (strstart(p, "none", &opts)) { display = DT_NONE; } else { @@ -3998,6 +4005,25 @@ int main(int argc, char **argv, char **envp) } } + if (display_type == DT_DEFAULT && !display_remote) { +#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) @@ -4226,20 +4252,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: @@ -4258,6 +4270,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; }