summaryrefslogtreecommitdiff
path: root/ui/sdl2.c
diff options
context:
space:
mode:
authorJindrich Makovicka <makovick@gmail.com>2017-11-12 20:30:26 +0100
committerGerd Hoffmann <kraxel@redhat.com>2017-11-16 09:57:47 +0100
commitfc49e7279d71489571a9934a2fee50be3890a888 (patch)
treecef6116c2a3cab55661676cfdbc738a80e476ed3 /ui/sdl2.c
parent1fa0f627d03cd0d0755924247cafeb42969016bf (diff)
downloadqemu-fc49e7279d71489571a9934a2fee50be3890a888.tar.gz
sdl2: Do not quit the emulator when an auxilliary window is closed
Signed-off-by: Jindrich Makovicka <makovick@gmail.com> Message-Id: <20171112193032.9724-3-makovick@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/sdl2.c')
-rw-r--r--ui/sdl2.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 53dd447fd2..05729af971 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -566,9 +566,14 @@ static void handle_windowevent(SDL_Event *ev)
update_displaychangelistener(&scon->dcl, 500);
break;
case SDL_WINDOWEVENT_CLOSE:
- if (!no_quit) {
- no_shutdown = 0;
- qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI);
+ if (qemu_console_is_graphic(scon->dcl.con)) {
+ if (!no_quit) {
+ no_shutdown = 0;
+ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI);
+ }
+ } else {
+ SDL_HideWindow(scon->real_window);
+ scon->hidden = true;
}
break;
case SDL_WINDOWEVENT_SHOWN: