From patchwork Fri Nov 17 10:06:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10062535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0C0A96023A for ; Fri, 17 Nov 2017 10:11:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 034292A8CC for ; Fri, 17 Nov 2017 10:11:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB4FD2A95B; Fri, 17 Nov 2017 10:11:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8BFDD2A8CC for ; Fri, 17 Nov 2017 10:11:18 +0000 (UTC) Received: from localhost ([::1]:44849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFdcD-0000Y1-Pv for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Nov 2017 05:11:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFdY4-0006eP-BK for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:07:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFdY1-00063O-5m for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:07:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59548) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFdY0-00060p-Vf for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:06:57 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B532C04AC54; Fri, 17 Nov 2017 10:06:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-103.ams2.redhat.com [10.36.116.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAFDF83CA3; Fri, 17 Nov 2017 10:06:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 21B5BECE; Fri, 17 Nov 2017 11:06:53 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 17 Nov 2017 11:06:49 +0100 Message-Id: <20171117100653.13015-2-kraxel@redhat.com> In-Reply-To: <20171117100653.13015-1-kraxel@redhat.com> References: <20171117100653.13015-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 17 Nov 2017 10:06:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/5] sdl2: Do not quit the emulator when an auxilliary window is closed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jindrich Makovicka , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Jindrich Makovicka Signed-off-by: Jindrich Makovicka Message-Id: <20171112193032.9724-3-makovick@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 11 ++++++++--- 1 file 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: