aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-03-01 11:05:35 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-03-05 08:44:11 +0100
commitdb71589fd9428156a5b366e348d895d445f77449 (patch)
treef6d17989d37f04ea75ce868ca610ecf4e6722230 /vl.c
parent136c67e07869227b21b3f627316e03679ce7b738 (diff)
console: add qemu display registry, add gtk
Add a registry for user interfaces. Add qemu_display_init and qemu_display_early_init helper functions for display initialization. Hook up gtk ui as first user. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20180301100547.18962-2-kraxel@redhat.com
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/vl.c b/vl.c
index a33ac008fb..a84b1372b8 100644
--- a/vl.c
+++ b/vl.c
@@ -2180,7 +2180,6 @@ static void parse_display(const char *p)
exit(1);
#endif
} else if (strstart(p, "gtk", &opts)) {
-#ifdef CONFIG_GTK
dpy.type = DISPLAY_TYPE_GTK;
while (*opts) {
const char *nextopt;
@@ -2212,10 +2211,6 @@ static void parse_display(const char *p)
}
opts = nextopt;
}
-#else
- error_report("GTK support is disabled");
- exit(1);
-#endif
} else if (strstart(p, "none", &opts)) {
dpy.type = DISPLAY_TYPE_NONE;
} else {
@@ -4331,6 +4326,9 @@ int main(int argc, char **argv, char **envp)
dpy.type = DISPLAY_TYPE_NONE;
#endif
}
+ if (dpy.type == DISPLAY_TYPE_DEFAULT) {
+ dpy.type = DISPLAY_TYPE_NONE;
+ }
if ((no_frame || alt_grab || ctrl_grab) && dpy.type != DISPLAY_TYPE_SDL) {
error_report("-no-frame, -alt-grab and -ctrl-grab are only valid "
@@ -4342,12 +4340,10 @@ int main(int argc, char **argv, char **envp)
"ignoring option");
}
- if (dpy.type == DISPLAY_TYPE_GTK) {
- early_gtk_display_init(&dpy);
- }
-
if (dpy.type == DISPLAY_TYPE_SDL) {
sdl_display_early_init(&dpy);
+ } else {
+ qemu_display_early_init(&dpy);
}
qemu_console_early_init();
@@ -4687,10 +4683,8 @@ int main(int argc, char **argv, char **envp)
case DISPLAY_TYPE_COCOA:
cocoa_display_init(ds, &dpy);
break;
- case DISPLAY_TYPE_GTK:
- gtk_display_init(ds, &dpy);
- break;
default:
+ qemu_display_init(ds, &dpy);
break;
}