diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2015-12-08 17:08:10 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:45:30 -0600 |
commit | 40481dffe7ecc1a7fdb8ce469e52b6ab2b716020 (patch) | |
tree | 5b5ec5b0d0978a598c9b0ab9a6468bff1530e1da | |
parent | 2a300165ac8477ad2762455a3110839f88762181 (diff) | |
download | hqemu-40481dffe7ecc1a7fdb8ce469e52b6ab2b716020.zip hqemu-40481dffe7ecc1a7fdb8ce469e52b6ab2b716020.tar.gz |
spice: reset cursor on resize
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>
-rw-r--r-- | ui/spice-display.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c index cdbc78d..4e5c8a2 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -460,6 +460,13 @@ 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) @@ -467,8 +474,6 @@ 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); @@ -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); |