Received: from eggs.gnu.org ([2001:4830:134:3::10]:47216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWh9S-0005zr-HP for qemu-devel@nongnu.org; Fri, 19 Feb 2016 04:15:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWh9N-0003BG-IT for qemu-devel@nongnu.org; Fri, 19 Feb 2016 04:15:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWh9N-0003B3-DB for qemu-devel@nongnu.org; Fri, 19 Feb 2016 04:14:57 -0500 From: Gerd Hoffmann Date: Fri, 19 Feb 2016 10:14:41 +0100 Message-Id: <1455873289-349-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1455873289-349-1-git-send-email-kraxel@redhat.com> References: <1455873289-349-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 04/12] spice: reset cursor on resize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: spice-devel@lists.freedesktop.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau 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=C3=A9 Lureau Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 14 ++++++++++++-- 1 file 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 *s= sd, =20 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 =3D qemu_spice_create_cursor_update(ssd, ssd->cu= rsor, 0); + } + qemu_mutex_unlock(&ssd->lock); } =20 static void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd) @@ -467,8 +474,6 @@ static void qemu_spice_cursor_refresh_unlocked(Simple= SpiceDisplay *ssd) if (ssd->cursor) { assert(ssd->dcl.con); dpy_cursor_define(ssd->dcl.con, ssd->cursor); - cursor_put(ssd->cursor); - ssd->cursor =3D NULL; } if (ssd->mouse_x !=3D -1 && ssd->mouse_y !=3D -1) { assert(ssd->dcl.con); @@ -750,6 +755,11 @@ static void display_mouse_define(DisplayChangeListen= er *dcl, SimpleSpiceDisplay *ssd =3D container_of(dcl, SimpleSpiceDisplay, dc= l); =20 qemu_mutex_lock(&ssd->lock); + if (c) { + cursor_get(c); + } + cursor_put(ssd->cursor); + ssd->cursor =3D c; ssd->hot_x =3D c->hot_x; ssd->hot_y =3D c->hot_y; g_free(ssd->ptr_move); --=20 1.8.3.1