Commit b7fb49f0 authored by Gerd Hoffmann's avatar Gerd Hoffmann
Browse files

console: add dpy_ui_info_supported



Allow ui code to check whenever the emulated
display supports display change notifications.

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent cf1ecc82
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
+6 −1
Original line number Diff line number Diff line
@@ -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;
    }