aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-03-13 12:21:14 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-05-06 08:38:05 +0200
commitb7fb49f0c709a406f79372be397367ff2550373b (patch)
tree2faae9d7306717c52edbb59641547c2c4f066cce
parentcf1ecc82ab84dbfb4b6eea02c329bf9c2aa856ec (diff)
console: add dpy_ui_info_supported
Allow ui code to check whenever the emulated display supports display change notifications. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--include/ui/console.h1
-rw-r--r--ui/console.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/include/ui/console.h b/include/ui/console.h
index 0b7589600b..e8b3a9ea8d 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 248dd605f1..406c36b864 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;
}