sdl2: show console #0 unconditionally
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 12 Sep 2018 11:43:00 +0000 (13:43 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 1 Oct 2018 09:29:03 +0000 (11:29 +0200)
Otherwise sdl2 will show no window in case no graphical
display device is present.

Reproducer: qemu -nodefaults -display sdl -serial vc

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180912114300.6976-1-kraxel@redhat.com

ui/sdl2.c

index 0a9a18a96415b56ade62d035d2998505eb412529..2696b95c79a82a9b65b2652cb3f5f115750b3230 100644 (file)
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -806,7 +806,8 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
     for (i = 0; i < sdl2_num_outputs; i++) {
         QemuConsole *con = qemu_console_lookup_by_index(i);
         assert(con != NULL);
-        if (!qemu_console_is_graphic(con)) {
+        if (!qemu_console_is_graphic(con) &&
+            qemu_console_get_index(con) != 0) {
             sdl2_console[i].hidden = true;
         }
         sdl2_console[i].idx = i;