Skip to content

Commit

Permalink
spice: reset cursor on resize
Browse files Browse the repository at this point in the history
Spice server will clear the cursor on resize. QXL driver reset it after
resize, however, virtio and other devices do not. Teach qemu to set it
back.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
elmarco authored and kraxel committed Feb 23, 2016
1 parent 1e31659 commit 58c7b61
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ui/spice-display.c
Expand Up @@ -460,15 +460,20 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,

memset(&ssd->dirty, 0, sizeof(ssd->dirty));
ssd->notify++;

qemu_mutex_lock(&ssd->lock);
if (ssd->cursor) {
g_free(ssd->ptr_define);
ssd->ptr_define = qemu_spice_create_cursor_update(ssd, ssd->cursor, 0);
}
qemu_mutex_unlock(&ssd->lock);
}

static void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd)
{
if (ssd->cursor) {
assert(ssd->dcl.con);
dpy_cursor_define(ssd->dcl.con, ssd->cursor);
cursor_put(ssd->cursor);
ssd->cursor = NULL;
}
if (ssd->mouse_x != -1 && ssd->mouse_y != -1) {
assert(ssd->dcl.con);
Expand Down Expand Up @@ -750,6 +755,11 @@ static void display_mouse_define(DisplayChangeListener *dcl,
SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);

qemu_mutex_lock(&ssd->lock);
if (c) {
cursor_get(c);
}
cursor_put(ssd->cursor);
ssd->cursor = c;
ssd->hot_x = c->hot_x;
ssd->hot_y = c->hot_y;
g_free(ssd->ptr_move);
Expand Down

0 comments on commit 58c7b61

Please sign in to comment.