From patchwork Tue Feb 23 14:24:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 8392681 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 876639F52D for ; Tue, 23 Feb 2016 14:26:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBE722015E for ; Tue, 23 Feb 2016 14:26:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2867202DD for ; Tue, 23 Feb 2016 14:26:52 +0000 (UTC) Received: from localhost ([::1]:57498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYDvQ-0002KC-8b for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Feb 2016 09:26:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYDt8-0006sC-Q4 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYDt5-0001SZ-LG for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYDt5-0001RO-Fn for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:27 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id BDB37C0C4ED2 for ; Tue, 23 Feb 2016 14:24:25 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1NEOOaN002575; Tue, 23 Feb 2016 09:24:25 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 04835822A7; Tue, 23 Feb 2016 15:24:24 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 23 Feb 2016 15:24:18 +0100 Message-Id: <1456237462-3687-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1456237462-3687-1-git-send-email-kraxel@redhat.com> References: <1456237462-3687-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [Qemu-devel] [PULL 4/8] spice: reset cursor on resize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André 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é 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 *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);