aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-08-30 13:38:08 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-09-04 14:00:38 +0400
commit742a6896ea1b83894e68b2dc455b63cea498bafc (patch)
tree08cf9e617d564cdad91ab5a5ee5e63f86be5808a /ui
parent6ce7b1fa8844db668f0a3c0b37b78b08d331a16a (diff)
downloadqemu-742a6896ea1b83894e68b2dc455b63cea498bafc.zip
qemu-742a6896ea1b83894e68b2dc455b63cea498bafc.tar.gz
qemu-742a6896ea1b83894e68b2dc455b63cea498bafc.tar.bz2
ui/vc: use common text console surface creation
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230830093843.3531473-35-marcandre.lureau@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/ui/console.c b/ui/console.c
index a3fd1c5..3d88495 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2569,18 +2569,13 @@ static void vc_chr_open(Chardev *chr,
height = qemu_console_get_height(NULL, 24 * FONT_HEIGHT);
} else {
s = QEMU_TEXT_CONSOLE(object_new(TYPE_QEMU_FIXED_TEXT_CONSOLE));
- QEMU_CONSOLE(s)->scanout.kind = SCANOUT_SURFACE;
- QEMU_CONSOLE(s)->surface = qemu_create_displaysurface(width, height);
}
+ dpy_gfx_replace_surface(QEMU_CONSOLE(s), qemu_create_displaysurface(width, height));
+
s->chr = chr;
drv->console = s;
- if (QEMU_CONSOLE(s)->scanout.kind != SCANOUT_SURFACE) {
- QEMU_CONSOLE(s)->surface = qemu_create_displaysurface(width, height);
- QEMU_CONSOLE(s)->scanout.kind = SCANOUT_SURFACE;
- }
-
/* set current text attributes to default */
drv->t_attrib = TEXT_ATTRIBUTES_DEFAULT;
text_console_resize(s);