ui: keep current cursor with QemuConsole

Keeping the current cursor around is useful, not only for VNC, but for
other displays. Let's move it down, see the following patches for other
usages.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Marc-André Lureau 2023-01-17 15:24:40 +04:00
parent 2512a026fa
commit 385ac97f8f
4 changed files with 11 additions and 6 deletions

View file

@ -94,6 +94,7 @@ struct QemuConsole {
uint32_t head;
QemuUIInfo ui_info;
QEMUTimer *ui_timer;
QEMUCursor *cursor;
const GraphicHwOps *hw_ops;
void *hw;
@ -1923,6 +1924,8 @@ void dpy_cursor_define(QemuConsole *con, QEMUCursor *cursor)
DisplayState *s = con->ds;
DisplayChangeListener *dcl;
cursor_unref(con->cursor);
con->cursor = cursor_ref(cursor);
if (!qemu_console_is_visible(con)) {
return;
}
@ -2288,6 +2291,11 @@ QemuConsole *qemu_console_lookup_unused(void)
return NULL;
}
QEMUCursor *qemu_console_get_cursor(QemuConsole *con)
{
return con->cursor;
}
bool qemu_console_is_visible(QemuConsole *con)
{
return (con == active_console) || (con->dcls > 0);