Received: from eggs.gnu.org ([2001:4830:134:3::10]:53934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymgsj-0004II-Bu for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:07:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymgsi-00048Z-JU for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:07:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymgsi-000489-BH for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:07:20 -0400 From: Gerd Hoffmann Date: Mon, 27 Apr 2015 13:07:06 +0200 Message-Id: <1430132826-1121-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1430132826-1121-1-git-send-email-kraxel@redhat.com> References: <1430132826-1121-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] [PULL 5/5] spice: learn to hide cursor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann From: Marc-Andr=C3=A9 Lureau Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index a09f6f8..c71a059 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -260,7 +260,8 @@ static void qemu_spice_create_update(SimpleSpiceDispl= ay *ssd) =20 static SimpleSpiceCursor* qemu_spice_create_cursor_update(SimpleSpiceDisplay *ssd, - QEMUCursor *c) + QEMUCursor *c, + int on) { size_t size =3D c ? c->width * c->height * 4 : 0; SimpleSpiceCursor *update; @@ -288,6 +289,8 @@ qemu_spice_create_cursor_update(SimpleSpiceDisplay *s= sd, cursor->data_size =3D size; cursor->chunk.data_size =3D size; memcpy(cursor->chunk.data, c->data, size); + } else if (!on) { + ccmd->type =3D QXL_CURSOR_HIDE; } else { ccmd->type =3D QXL_CURSOR_MOVE; ccmd->u.position.x =3D ssd->ptr_x + ssd->hot_x; @@ -738,7 +741,7 @@ static void display_mouse_set(DisplayChangeListener *= dcl, if (ssd->ptr_move) { g_free(ssd->ptr_move); } - ssd->ptr_move =3D qemu_spice_create_cursor_update(ssd, NULL); + ssd->ptr_move =3D qemu_spice_create_cursor_update(ssd, NULL, on); qemu_mutex_unlock(&ssd->lock); } =20 @@ -757,7 +760,7 @@ static void display_mouse_define(DisplayChangeListene= r *dcl, if (ssd->ptr_define) { g_free(ssd->ptr_define); } - ssd->ptr_define =3D qemu_spice_create_cursor_update(ssd, c); + ssd->ptr_define =3D qemu_spice_create_cursor_update(ssd, c, 0); qemu_mutex_unlock(&ssd->lock); } =20 --=20 1.8.3.1