From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH 7/7] gtk: make default UI (v3)
Date: Wed, 5 Sep 2012 14:18:44 -0500 [thread overview]
Message-ID: <1346872724-9156-8-git-send-email-aliguori@us.ibm.com> (raw)
In-Reply-To: <1346872724-9156-1-git-send-email-aliguori@us.ibm.com>
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 <aliguori@us.ibm.com>
---
v1 -> v3:
- fix -display gtk
- fix -vnc none
---
vl.c | 45 +++++++++++++++++++++++++++++++--------------
1 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/vl.c b/vl.c
index 7c577fa..47c5974 100644
--- a/vl.c
+++ b/vl.c
@@ -1837,6 +1837,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 {
@@ -3418,6 +3425,25 @@ int main(int argc, char **argv, char **envp)
add_device_config(DEV_VIRTCON, "vc:80Cx24C");
}
+ 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)
@@ -3637,20 +3663,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:
@@ -3669,6 +3681,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.5.4
prev parent reply other threads:[~2012-09-05 19:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 19:18 [Qemu-devel] [PATCH 0/7] Add GTK UI to enable basic accessibility (v3) Anthony Liguori
2012-09-05 19:18 ` [Qemu-devel] [PATCH 1/7] console: allow VCs to be overridden by UI Anthony Liguori
2012-09-05 19:18 ` [Qemu-devel] [PATCH 2/7] ui: add basic GTK gui (v2) Anthony Liguori
2012-09-05 19:53 ` Blue Swirl
2012-09-05 20:00 ` Eric Blake
2012-09-05 20:38 ` Anthony Liguori
2012-09-05 21:00 ` Blue Swirl
2012-09-05 23:07 ` Anthony Liguori
2012-09-08 7:00 ` Blue Swirl
2012-09-05 20:04 ` Stefan Weil
2012-09-05 20:39 ` Anthony Liguori
2012-09-05 20:45 ` Jan Kiszka
2012-09-05 22:55 ` Anthony Liguori
2012-09-05 20:54 ` Jan Kiszka
2012-09-05 19:18 ` [Qemu-devel] [PATCH 3/7] gtk: add virtual console support (v2) Anthony Liguori
2012-09-05 19:18 ` [Qemu-devel] [PATCH 4/7] gtk: add support for input grabbing (v2) Anthony Liguori
2012-09-05 19:37 ` Jan Kiszka
2012-09-05 20:40 ` Anthony Liguori
2012-09-05 20:43 ` Jan Kiszka
2012-09-05 19:18 ` [Qemu-devel] [PATCH 5/7] gtk: add support for screen scaling and full screen (v3) Anthony Liguori
2012-09-05 19:18 ` [Qemu-devel] [PATCH 6/7] gtk: add translation support Anthony Liguori
2012-09-06 12:18 ` Kevin Wolf
2012-09-06 12:40 ` Anthony Liguori
2012-09-06 13:00 ` Peter Maydell
2012-09-05 19:18 ` Anthony Liguori [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346872724-9156-8-git-send-email-aliguori@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).