summary refs log tree commit diff stats
path: root/ui/sdl2.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2018-07-09 20:44:10 +0200
committerGerd Hoffmann <kraxel@redhat.com>2018-08-24 08:40:11 +0200
commit6fb34ffcaae0823304b2e9dd96ea67e59d11b780 (patch)
tree4d89510b4b131fb590a2bde479f0b78779b44c2c /ui/sdl2.c
parent006bf4641b553565990a6b18e0cff36972a36773 (diff)
downloadfocaccia-qemu-6fb34ffcaae0823304b2e9dd96ea67e59d11b780.tar.gz
focaccia-qemu-6fb34ffcaae0823304b2e9dd96ea67e59d11b780.zip
ui/sdl2: Fix broken -full-screen CLI option
We've got to set the gui_fullscreen variable before creating the
SDL2 window, otherwise the initial window will not be created in
fullscreen mode.

Buglink: https://bugs.launchpad.net/bugs/1780812
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-id: 1531161850-6860-1-git-send-email-thuth@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/sdl2.c')
-rw-r--r--ui/sdl2.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 755a7134ff..0a9a18a964 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -790,6 +790,8 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
     memset(&info, 0, sizeof(info));
     SDL_VERSION(&info.version);
 
+    gui_fullscreen = o->has_full_screen && o->full_screen;
+
     for (i = 0;; i++) {
         QemuConsole *con = qemu_console_lookup_by_index(i);
         if (!con) {
@@ -842,17 +844,14 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
         g_free(filename);
     }
 
-    if (sdl2_console->opts->has_full_screen &&
-        sdl2_console->opts->full_screen) {
-        gui_fullscreen = 1;
+    gui_grab = 0;
+    if (gui_fullscreen) {
         sdl_grab_start(0);
     }
 
     mouse_mode_notifier.notify = sdl_mouse_mode_change;
     qemu_add_mouse_mode_change_notifier(&mouse_mode_notifier);
 
-    gui_grab = 0;
-
     sdl_cursor_hidden = SDL_CreateCursor(&data, &data, 8, 1, 0, 0);
     sdl_cursor_normal = SDL_GetCursor();