diff --git a/ui/xemu.c b/ui/xemu.c index bc018732ac..7fd2c0d5b9 100644 --- a/ui/xemu.c +++ b/ui/xemu.c @@ -41,6 +41,7 @@ #include "ui/input.h" #include "ui/xemu-display.h" #include "sysemu/runstate.h" +#include "sysemu/runstate-action.h" #include "sysemu/sysemu.h" #include "xemu-hud.h" #include "xemu-input.h" @@ -609,7 +610,7 @@ static void handle_windowevent(SDL_Event *ev) allow_close = false; } if (allow_close) { - no_shutdown = 0; + shutdown_action = SHUTDOWN_ACTION_POWEROFF; qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); } } else { @@ -661,7 +662,7 @@ void sdl2_poll_events(struct sdl2_console *scon) allow_close = false; } if (allow_close) { - no_shutdown = 0; + shutdown_action = SHUTDOWN_ACTION_POWEROFF; qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); } break;