From: Tianlan Zhou Date: Wed, 7 Feb 2024 17:20:25 +0000 (+0800) Subject: ui/console: Fix console resize with placeholder surface X-Git-Tag: v7.2.10~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=086850aa807151364ff6cccdadba77c0860a93b5;p=thirdparty%2Fqemu.git ui/console: Fix console resize with placeholder surface In `qemu_console_resize()`, the old surface of the console is keeped if the new console size is the same as the old one. If the old surface is a placeholder, and the new size of console is the same as the placeholder surface (640*480), the surface won't be replace. In this situation, the surface's `QEMU_PLACEHOLDER_FLAG` flag is still set, so the console won't be displayed in SDL display mode. This patch fixes this problem by forcing a new surface if the old one is a placeholder. Signed-off-by: Tianlan Zhou Reviewed-by: Marc-André Lureau Message-ID: <20240207172024.8-1-bobby825@126.com> (cherry picked from commit 95b08fee8f68d284a5028d37fd28be7a70c8e92b) Signed-off-by: Michael Tokarev --- diff --git a/ui/console.c b/ui/console.c index 52414d6aa3a..269cf27163d 100644 --- a/ui/console.c +++ b/ui/console.c @@ -2583,7 +2583,7 @@ void qemu_console_resize(QemuConsole *s, int width, int height) assert(s->console_type == GRAPHIC_CONSOLE); if ((s->scanout.kind != SCANOUT_SURFACE || - (surface && surface->flags & QEMU_ALLOCATED_FLAG)) && + (surface && !is_buffer_shared(surface) && !is_placeholder(surface))) && qemu_console_get_width(s, -1) == width && qemu_console_get_height(s, -1) == height) { return;