From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqgm5-0005LR-4x for qemu-devel@nongnu.org; Fri, 08 May 2015 07:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yqgm3-0000jp-RT for qemu-devel@nongnu.org; Fri, 08 May 2015 07:49:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqgm3-0000jR-Bk for qemu-devel@nongnu.org; Fri, 08 May 2015 07:48:59 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t48Bmw6i032217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 8 May 2015 07:48:58 -0400 From: Gerd Hoffmann Date: Fri, 8 May 2015 13:48:48 +0200 Message-Id: <1431085731-6362-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1431085731-6362-1-git-send-email-kraxel@redhat.com> References: <1431085731-6362-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 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 0b75896..e8b3a9e 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -228,6 +228,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