From patchwork Wed Dec 21 00:38:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 9482415 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 6A98C6082B for ; Wed, 21 Dec 2016 00:38:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C13828159 for ; Wed, 21 Dec 2016 00:38:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50CD328210; Wed, 21 Dec 2016 00:38:42 +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 B0BEE281C3 for ; Wed, 21 Dec 2016 00:38:41 +0000 (UTC) Received: from localhost ([::1]:54239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJUvY-0001ip-07 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 20 Dec 2016 19:38:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJUvA-0001h2-80 for qemu-devel@nongnu.org; Tue, 20 Dec 2016 19:38:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJUv7-00087b-5t for qemu-devel@nongnu.org; Tue, 20 Dec 2016 19:38:16 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:59698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJUv6-00087C-UD for qemu-devel@nongnu.org; Tue, 20 Dec 2016 19:38:13 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id A4728B3AF; Wed, 21 Dec 2016 01:38:11 +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 HlRNncKNK1uO; Wed, 21 Dec 2016 01:38:09 +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 7FA69B3A9; Wed, 21 Dec 2016 01:38:09 +0100 (CET) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.88) (envelope-from ) id 1cJUv2-0005qD-OS; Wed, 21 Dec 2016 01:38:08 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org, Gerd Hoffmann Date: Wed, 21 Dec 2016 01:38:04 +0100 Message-Id: <20161221003806.22412-2-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161221003806.22412-1-samuel.thibault@ens-lyon.org> References: <20161221003806.22412-1-samuel.thibault@ens-lyon.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 141.255.128.1 Subject: [Qemu-devel] [PATCH 1/3] console: add API to get underlying gui 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 adds two console functions, qemu_console_set_window_id and qemu_graphic_console_get_window_id, to let graphical backend record the window id in the QemuConsole structure, and let the baum driver read it. Signed-off-by: Samuel Thibault --- Difference from v4: select console with a QemuConsole* parameter instead of an integer index. --- include/ui/console.h | 4 ++++ ui/console.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index e2589e2134..ee8c407cac 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -394,6 +394,10 @@ uint32_t qemu_console_get_head(QemuConsole *con); QemuUIInfo *qemu_console_get_ui_info(QemuConsole *con); int qemu_console_get_width(QemuConsole *con, int fallback); int qemu_console_get_height(QemuConsole *con, int fallback); +/* Return the low-level window id for the console */ +int qemu_console_get_window_id(QemuConsole *con); +/* Set the low-level window id for the console */ +void qemu_console_set_window_id(QemuConsole *con, int window_id); void console_select(unsigned int index); void qemu_console_resize(QemuConsole *con, int width, int height); diff --git a/ui/console.c b/ui/console.c index ed888e55ea..b9575f2ee5 100644 --- a/ui/console.c +++ b/ui/console.c @@ -124,6 +124,7 @@ struct QemuConsole { int dcls; DisplayChangeListener *gl; bool gl_block; + int window_id; /* Graphic console state. */ Object *device; @@ -273,6 +274,16 @@ void graphic_hw_gl_block(QemuConsole *con, bool block) } } +int qemu_console_get_window_id(QemuConsole *con) +{ + return con->window_id; +} + +void qemu_console_set_window_id(QemuConsole *con, int window_id) +{ + con->window_id = window_id; +} + void graphic_hw_invalidate(QemuConsole *con) { if (!con) {