From 3c293a46627063eb4b12d808c7ec43b1cff8e463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sun, 19 Mar 2023 15:10:17 +0400 Subject: [PATCH] ui: return the default console cursor when con == NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VNC code relies on con==NULL to mean the default console. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1548 Fixes: commit 385ac97f8 ("ui: keep current cursor with QemuConsole") Signed-off-by: Marc-André Lureau Reported-by: Helge Konetzka Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230319111017.1319880-1-marcandre.lureau@redhat.com> --- ui/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/console.c b/ui/console.c index f3783021e5..6e8a3cdc62 100644 --- a/ui/console.c +++ b/ui/console.c @@ -2303,6 +2303,9 @@ QemuConsole *qemu_console_lookup_unused(void) QEMUCursor *qemu_console_get_cursor(QemuConsole *con) { + if (con == NULL) { + con = active_console; + } return con->cursor; }