aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-08-30 13:38:16 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-09-04 14:38:15 +0400
commit322dae4bc817fe288a103427f53de2a945daca27 (patch)
treef7bd8f02f07d572c59818db64fa276a44da3da4d /ui
parent893fe23e7dc675d650a4da710efe62a53c2341ee (diff)
ui/vc: move text console invalidate in helper
This will allow to split the VC code in a separate unit more easily. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230830093843.3531473-43-marcandre.lureau@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/console.c b/ui/console.c
index b1d375ecb4..ba9da8c1b3 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2500,13 +2500,11 @@ static void vc_chr_set_echo(Chardev *chr, bool echo)
drv->console->echo = echo;
}
-static void text_console_update_cursor(void *opaque)
+int qemu_invalidate_text_consoles(void)
{
QemuConsole *s;
int count = 0;
- cursor_visible_phase = !cursor_visible_phase;
-
QTAILQ_FOREACH(s, &consoles, next) {
if (qemu_console_is_graphic(s) ||
!qemu_console_is_visible(s)) {
@@ -2516,7 +2514,14 @@ static void text_console_update_cursor(void *opaque)
graphic_hw_invalidate(s);
}
- if (count) {
+ return count;
+}
+
+static void text_console_update_cursor(void *opaque)
+{
+ cursor_visible_phase = !cursor_visible_phase;
+
+ if (qemu_invalidate_text_consoles()) {
timer_mod(cursor_timer,
qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + CONSOLE_CURSOR_PERIOD / 2);
}