diff options
author | Akihiko Odaki <akihiko.odaki@gmail.com> | 2021-02-25 19:13:14 +0900 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-03-04 09:35:36 +0100 |
commit | b5a087b071b6d4752234d8c190cc7f22f44ec2e9 (patch) | |
tree | 5418155697d1a2fa255ec063a48573e4e788e627 /ui/console.c | |
parent | 4313739a57a34998ebaf032dcdda065c0105a939 (diff) | |
download | qemu-b5a087b071b6d4752234d8c190cc7f22f44ec2e9.zip qemu-b5a087b071b6d4752234d8c190cc7f22f44ec2e9.tar.gz qemu-b5a087b071b6d4752234d8c190cc7f22f44ec2e9.tar.bz2 |
ui/console: Add placeholder flag to message surface
The surfaces created with former qemu_create_message_surface
did not display the content from the guest and always contained
simple messages describing the reason.
A display backend may want to hide the window showing such a
surface. This change renames the function to
qemu_create_placeholder_surface, and adds "placeholder" flag; the
display can check the flag to decide to do anything special like
hiding the window.
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-Id: <20210225101316.83940-1-akihiko.odaki@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/console.c')
-rw-r--r-- | ui/console.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/console.c b/ui/console.c index c5d11bc..32823fa 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1436,8 +1436,8 @@ DisplaySurface *qemu_create_displaysurface_pixman(pixman_image_t *image) return surface; } -DisplaySurface *qemu_create_message_surface(int w, int h, - const char *msg) +DisplaySurface *qemu_create_placeholder_surface(int w, int h, + const char *msg) { DisplaySurface *surface = qemu_create_displaysurface(w, h); pixman_color_t bg = color_table_rgb[0][QEMU_COLOR_BLACK]; @@ -1454,6 +1454,7 @@ DisplaySurface *qemu_create_message_surface(int w, int h, x+i, y, FONT_WIDTH, FONT_HEIGHT); qemu_pixman_image_unref(glyph); } + surface->flags |= QEMU_PLACEHOLDER_FLAG; return surface; } @@ -1550,7 +1551,7 @@ void register_displaychangelistener(DisplayChangeListener *dcl) dcl->ops->dpy_gfx_switch(dcl, con->surface); } else { if (!dummy) { - dummy = qemu_create_message_surface(640, 480, nodev); + dummy = qemu_create_placeholder_surface(640, 480, nodev); } dcl->ops->dpy_gfx_switch(dcl, dummy); } @@ -1998,7 +1999,7 @@ QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, &error_abort); } - surface = qemu_create_message_surface(width, height, noinit); + surface = qemu_create_placeholder_surface(width, height, noinit); dpy_gfx_replace_surface(s, surface); return s; } @@ -2027,7 +2028,7 @@ void graphic_console_close(QemuConsole *con) if (con->gl) { dpy_gl_scanout_disable(con); } - surface = qemu_create_message_surface(width, height, unplugged); + surface = qemu_create_placeholder_surface(width, height, unplugged); dpy_gfx_replace_surface(con, surface); } |