From patchwork Sun Oct 30 15:08:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 9404511 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 385F360588 for ; Sun, 30 Oct 2016 15:09:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C79828F45 for ; Sun, 30 Oct 2016 15:09:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2175B28F56; Sun, 30 Oct 2016 15:09:33 +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 D318D28F45 for ; Sun, 30 Oct 2016 15:09:32 +0000 (UTC) Received: from localhost ([::1]:58830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0rjo-0005n7-3p for patchwork-qemu-devel@patchwork.kernel.org; Sun, 30 Oct 2016 11:09:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0rjK-0005lg-E7 for qemu-devel@nongnu.org; Sun, 30 Oct 2016 11:09:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0rjJ-0002GG-Mx for qemu-devel@nongnu.org; Sun, 30 Oct 2016 11:09:02 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:41753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0rjJ-0002Fd-HP for qemu-devel@nongnu.org; Sun, 30 Oct 2016 11:09:01 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 25C309A59; Sun, 30 Oct 2016 16:09:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W5oTxQ1TlKXe; Sun, 30 Oct 2016 16:08:59 +0100 (CET) Received: from var.youpi.perso.aquilenet.fr (unknown [IPv6:2a01:cb19:181:c200:3602:86ff:fe2c:6a19]) by hera.aquilenet.fr (Postfix) with ESMTPSA id AE63D9A5B; Sun, 30 Oct 2016 16:08:58 +0100 (CET) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.87) (envelope-from ) id 1c0rjG-0000g2-4A; Sun, 30 Oct 2016 16:08:58 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Sun, 30 Oct 2016 16:08:57 +0100 Message-Id: <20161030150857.2557-4-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161030150857.2557-1-samuel.thibault@ens-lyon.org> References: <20161030150857.2557-1-samuel.thibault@ens-lyon.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:474::1 Subject: [Qemu-devel] [PATCH 3/3] sdl2: set window ID 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: Samuel Thibault Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This uses the console API to record the window ID of the SDL2 windows. Signed-off-by: Samuel Thibault --- ui/sdl2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 30d2a3c..b464f16 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -761,6 +761,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) uint8_t data = 0; char *filename; int i; + SDL_SysWMinfo info; if (no_frame) { gui_noframe = 1; @@ -786,6 +787,8 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) exit(1); } SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1"); + memset(&info, 0, sizeof(info)); + SDL_VERSION(&info.version); for (i = 0;; i++) { QemuConsole *con = qemu_console_lookup_by_index(i); @@ -813,6 +816,10 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) #endif sdl2_console[i].dcl.con = con; register_displaychangelistener(&sdl2_console[i].dcl); + + if (SDL_GetWindowWMInfo(sdl2_console[i].real_window, &info)) { + qemu_console_set_window_id(i, info.info.x11.window); + } } /* Load a 32x32x4 image. White pixels are transparent. */