Skip to content
Snippets Groups Projects
Commit 6effaa16 authored by Marc-André Lureau's avatar Marc-André Lureau
Browse files

ui: set cursor position upon listener registration


Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
parent de00b60d
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,7 @@ struct QemuConsole {
QemuUIInfo ui_info;
QEMUTimer *ui_timer;
QEMUCursor *cursor;
int cursor_x, cursor_y, cursor_on;
const GraphicHwOps *hw_ops;
void *hw;
......@@ -1665,6 +1666,9 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
if (con && con->cursor && dcl->ops->dpy_cursor_define) {
dcl->ops->dpy_cursor_define(dcl, con->cursor);
}
if (con && dcl->ops->dpy_mouse_set) {
dcl->ops->dpy_mouse_set(dcl, con->cursor_x, con->cursor_y, con->cursor_on);
}
text_console_update_cursor(NULL);
}
......@@ -1909,6 +1913,9 @@ void dpy_mouse_set(QemuConsole *con, int x, int y, int on)
DisplayState *s = con->ds;
DisplayChangeListener *dcl;
con->cursor_x = x;
con->cursor_y = y;
con->cursor_on = on;
if (!qemu_console_is_visible(con)) {
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment