@@ -293,6 +293,8 @@ int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info);
void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h);
void dpy_gfx_replace_surface(QemuConsole *con,
DisplaySurface *surface);
+void dpy_gfx_switch_surface(QemuConsole *con,
+ DisplaySurface *surface);
void dpy_text_cursor(QemuConsole *con, int x, int y);
void dpy_text_update(QemuConsole *con, int x, int y, int w, int h);
void dpy_text_resize(QemuConsole *con, int w, int h);
@@ -1595,6 +1595,22 @@ void dpy_gfx_replace_surface(QemuConsole *con,
qemu_free_displaysurface(old_surface);
}
+void dpy_gfx_switch_surface(QemuConsole *con,
+ DisplaySurface *surface)
+{
+ DisplayState *s = con->ds;
+ DisplayChangeListener *dcl;
+
+ QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
+ if (dcl->ops->dpy_gfx_switch) {
+ dcl->ops->dpy_gfx_switch(dcl, surface);
+ }
+ }
+}
+
bool dpy_gfx_check_format(QemuConsole *con,
pixman_format_code_t format)
{
dpy_gfx_switch_surface is used to ask each valid DisplayChangeListener of a QemuConsole to switch to another DisplaySurface. Signed-off-by: Tina Zhang <tina.zhang@intel.com> --- include/ui/console.h | 2 ++ ui/console.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+)