From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypb16-0004dw-Kb for qemu-devel@nongnu.org; Tue, 05 May 2015 07:28:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ypb12-00051a-Jo for qemu-devel@nongnu.org; Tue, 05 May 2015 07:28:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypb12-0004zg-5O for qemu-devel@nongnu.org; Tue, 05 May 2015 07:27:56 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id CC3CD8EFD2 for ; Tue, 5 May 2015 11:27:55 +0000 (UTC) From: Gerd Hoffmann Date: Tue, 5 May 2015 13:27:43 +0200 Message-Id: <1430825266-30300-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1430825266-30300-1-git-send-email-kraxel@redhat.com> References: <1430825266-30300-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/5] console: add dpy_ui_info_supported List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Allow ui code to check whenever the emulated display supports display change notifications. Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 1 + ui/console.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/ui/console.h b/include/ui/console.h index 03cd665..2f92895 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -218,6 +218,7 @@ void update_displaychangelistener(DisplayChangeListener *dcl, uint64_t interval); void unregister_displaychangelistener(DisplayChangeListener *dcl); +bool dpy_ui_info_supported(QemuConsole *con); int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info); void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h); diff --git a/ui/console.c b/ui/console.c index 248dd60..406c36b 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1391,11 +1391,16 @@ static void dpy_set_ui_info_timer(void *opaque) con->hw_ops->ui_info(con->hw, con->head, &con->ui_info); } +bool dpy_ui_info_supported(QemuConsole *con) +{ + return con->hw_ops->ui_info != NULL; +} + int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info) { assert(con != NULL); con->ui_info = *info; - if (!con->hw_ops->ui_info) { + if (!dpy_ui_info_supported(con)) { return -1; } -- 1.8.3.1