[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 42/52] ui/vc: move text console invalidate in helper
From: |
marcandre . lureau |
Subject: |
[PULL 42/52] ui/vc: move text console invalidate in helper |
Date: |
Mon, 4 Sep 2023 15:52:39 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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>
---
include/ui/console.h | 1 +
ui/console.c | 13 +++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index 0f7f50deaf..91d8bbc9dc 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -521,6 +521,7 @@ void console_select(unsigned int index);
void qemu_console_resize(QemuConsole *con, int width, int height);
DisplaySurface *qemu_console_surface(QemuConsole *con);
void coroutine_fn qemu_console_co_wait_update(QemuConsole *con);
+int qemu_invalidate_text_consoles(void);
/* console-gl.c */
#ifdef CONFIG_OPENGL
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);
}
--
2.41.0
- [PULL 35/52] ui/console: declare console types in console.h, (continued)
- [PULL 35/52] ui/console: declare console types in console.h, marcandre . lureau, 2023/09/04
- [PULL 37/52] ui/console: rename vga_ functions with qemu_console_, marcandre . lureau, 2023/09/04
- [PULL 33/52] ui/console: remove need for g_width/g_height, marcandre . lureau, 2023/09/04
- [PULL 34/52] ui/vc: use common text console surface creation, marcandre . lureau, 2023/09/04
- [PULL 36/52] ui/console: use QEMU_PIXMAN_COLOR helpers, marcandre . lureau, 2023/09/04
- [PULL 38/52] ui/console: assert(surface) where appropriate, marcandre . lureau, 2023/09/04
- [PULL 39/52] ui/console: fold text_console_update_cursor_timer, marcandre . lureau, 2023/09/04
- [PULL 40/52] ui/vc: skip text console resize when possible, marcandre . lureau, 2023/09/04
- [PULL 41/52] ui/console: minor stylistic changes, marcandre . lureau, 2023/09/04
- [PULL 43/52] ui/vc: do not parse VC-specific options in Spice and GTK, marcandre . lureau, 2023/09/04
- [PULL 42/52] ui/vc: move text console invalidate in helper,
marcandre . lureau <=
- [PULL 44/52] ui/vc: change the argument for QemuTextConsole, marcandre . lureau, 2023/09/04
- [PULL 45/52] ui/spice-display: Avoid dynamic stack allocation, marcandre . lureau, 2023/09/04
- [PULL 46/52] ui/vnc-enc-hextile: Use static rather than dynamic length stack array, marcandre . lureau, 2023/09/04
- [PULL 47/52] ui/vnc-enc-tight: Avoid dynamic stack allocation, marcandre . lureau, 2023/09/04
- [PULL 48/52] ui/dbus: Properly dispose touch/mouse dbus objects, marcandre . lureau, 2023/09/04
- [PULL 49/52] ui/dbus: implement damage regions for GL, marcandre . lureau, 2023/09/04
- [PULL 50/52] ui/vdagent: call vdagent_disconnect() when agent connection is lost, marcandre . lureau, 2023/09/04
- [PULL 51/52] ui/vdagent: Unregister input handler of mouse during finalization, marcandre . lureau, 2023/09/04
- [PULL 52/52] ui/gtk: fix leaks found wtih fuzzing, marcandre . lureau, 2023/09/04
- Re: [PULL 00/52] UI patches, Stefan Hajnoczi, 2023/09/06