qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/3] ui/console: Pass placeholder surface to displays


From: Gerd Hoffmann
Subject: Re: [PATCH v3 2/3] ui/console: Pass placeholder surface to displays
Date: Thu, 25 Feb 2021 10:06:39 +0100

> +static void dpy_gfx_switch(DisplayChangeListener *dcl, DisplaySurface 
> *surface)

int width, int height;

> +    static DisplaySurface *placeholder;
> +    static const char placeholder_msg[] = "Display output is not active.";
> +    DisplaySurface *broadcast;
> +
> +    if (!dcl->ops->dpy_gfx_switch) {
> +        return;
> +    }
> +
> +    if (surface) {
> +        broadcast = surface;
> +    } else {
> +        if (!placeholder) {
> +            placeholder = qemu_create_placeholder_surface(640, 480, 
> placeholder_msg);
> +        }

Just create a new one unconditionally.

> @@ -1685,9 +1704,7 @@ void dpy_gfx_replace_surface(QemuConsole *con,
>          if (con != (dcl->con ? dcl->con : active_console)) {
>              continue;
>          }
> -        if (dcl->ops->dpy_gfx_switch) {
> -            dcl->ops->dpy_gfx_switch(dcl, surface);
> -        }
> +        dpy_gfx_switch(dcl, surface);

You can look at the old_surface here and pass the size to
dpy_gfx_switch(), so the placeholder is created with the same size.

take care,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]