All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: spice-devel@lists.freedesktop.org,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH v2 04/12] spice: reset cursor on resize
Date: Fri, 19 Feb 2016 10:14:41 +0100	[thread overview]
Message-ID: <1455873289-349-5-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1455873289-349-1-git-send-email-kraxel@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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>
---
 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);
-- 
1.8.3.1

  parent reply	other threads:[~2016-02-19  9:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19  9:14 [Qemu-devel] [PATCH v2 00/12] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 01/12] spice: init dcl before registering qxl interface Gerd Hoffmann
2016-02-19 12:27   ` Marc-André Lureau
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 02/12] configure: add dma-buf support detection Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 03/12] egl-helpers: add functions for render nodes and dma-buf passing Gerd Hoffmann
2016-02-19  9:14 ` Gerd Hoffmann [this message]
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 05/12] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 06/12] spice: add unblock timer Gerd Hoffmann
2016-02-19 12:34   ` Marc-André Lureau
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 07/12] spice: tweak debug messages Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 08/12] console: track gl_block state in QemuConsole Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 09/12] spice/gl: render DisplaySurface via opengl Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 10/12] spice/gl: create dummy primary surface (RfC) Gerd Hoffmann
2016-03-18 13:17   ` Gerd Hoffmann
2016-03-18 13:45     ` Marc-André Lureau
2016-03-21 10:24       ` Gerd Hoffmann
2016-03-21 18:24         ` Marc-André Lureau
2016-05-23 13:52           ` Gerd Hoffmann
2016-05-23 14:03             ` Marc-André Lureau
2016-05-24 13:39               ` Gerd Hoffmann
2016-05-24 19:34                 ` [Qemu-devel] [Spice-devel] " Marc-André Lureau
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 11/12] spice: add & use qemu_spice_gl_monitor_config Gerd Hoffmann
2016-02-19 12:32   ` Marc-André Lureau
2016-04-28 17:21     ` Marc-André Lureau
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 12/12] [fixup] spice: qemu_spice_gl_monitor_config + surface Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455873289-349-5-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=spice-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.