[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
- [PATCH] ui/console: Assert graphic console surface is not NULL, Akihiko Odaki, 2021/02/19
- Re: [PATCH] ui/console: Assert graphic console surface is not NULL, Gerd Hoffmann, 2021/02/19
- [PATCH v2] ui/console: Pass placeholder surface to displays, Akihiko Odaki, 2021/02/20
- Re: [PATCH v2] ui/console: Pass placeholder surface to displays, Gerd Hoffmann, 2021/02/22
- Re: [PATCH v2] ui/console: Pass placeholder surface to displays, Akihiko Odaki, 2021/02/22
- Re: [PATCH v2] ui/console: Pass placeholder surface to displays, Gerd Hoffmann, 2021/02/24
- [PATCH v3 1/3] ui/console: Add placeholder flag to message surface, Akihiko Odaki, 2021/02/24
- [PATCH v3 2/3] ui/console: Pass placeholder surface to displays, Akihiko Odaki, 2021/02/24
- Re: [PATCH v3 2/3] ui/console: Pass placeholder surface to displays,
Gerd Hoffmann <=
- [PATCH v3 3/3] virtio-gpu: Do not distinguish the primary console, Akihiko Odaki, 2021/02/24
- Re: [PATCH v3 3/3] virtio-gpu: Do not distinguish the primary console, Gerd Hoffmann, 2021/02/25
- Re: [PATCH v3 3/3] virtio-gpu: Do not distinguish the primary console, Akihiko Odaki, 2021/02/25
- Re: [PATCH v3 3/3] virtio-gpu: Do not distinguish the primary console, Gerd Hoffmann, 2021/02/25
- Re: [PATCH v3 1/3] ui/console: Add placeholder flag to message surface, Gerd Hoffmann, 2021/02/25