From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDpjg-0002Ua-Ti for qemu-devel@nongnu.org; Sun, 12 Nov 2017 05:43:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDpje-000449-S1 for qemu-devel@nongnu.org; Sun, 12 Nov 2017 05:43:32 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:38741) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eDpje-00043e-LX for qemu-devel@nongnu.org; Sun, 12 Nov 2017 05:43:30 -0500 Received: by mail-wm0-x243.google.com with SMTP id p75so9768483wmg.3 for ; Sun, 12 Nov 2017 02:43:30 -0800 (PST) From: Jindrich Makovicka Date: Sun, 12 Nov 2017 11:42:40 +0100 Message-Id: <20171112104246.10007-3-makovick@gmail.com> In-Reply-To: <20171112104246.10007-1-makovick@gmail.com> References: <20171023210803.20998-1-makovick@gmail.com> <20171112104246.10007-1-makovick@gmail.com> Subject: [Qemu-devel] [PATCH 2/8] sdl2: Do not quit the emulator when an auxilliary window is closed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers , Gerd Hoffmann , Cole Robinson Cc: Jindrich Makovicka --- ui/sdl2.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 774904cbf2..dfbd0de791 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: -- 2.15.0