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 4/8] spice: reset cursor on resize
Date: Thu, 18 Feb 2016 10:26:46 +0100	[thread overview]
Message-ID: <1455787610-31787-5-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1455787610-31787-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 8a5b325..2a2a7c1 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-18  9:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18  9:26 [Qemu-devel] [PATCH 0/8] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-18  9:26 ` [Qemu-devel] [PATCH 1/8] configure: add dma-buf support detection Gerd Hoffmann
2016-02-18 12:30   ` Marc-André Lureau
2016-02-18  9:26 ` [Qemu-devel] [PATCH 2/8] egl-helpers: add functions for render nodes and dma-buf passing Gerd Hoffmann
2016-02-18 12:30   ` Marc-André Lureau
2016-02-18  9:26 ` [Qemu-devel] [PATCH 3/8] console: track gl_block state in QemuConsole Gerd Hoffmann
2016-02-18 12:30   ` Marc-André Lureau
2016-02-18  9:26 ` Gerd Hoffmann [this message]
2016-02-18  9:26 ` [Qemu-devel] [PATCH 5/8] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-18 12:30   ` Marc-André Lureau
2016-02-18 16:30   ` Eric Blake
2016-02-18 16:55     ` Marc-André Lureau
2016-02-18  9:26 ` [Qemu-devel] [PATCH 6/8] spice: tweak debug messages Gerd Hoffmann
2016-02-18  9:26 ` [Qemu-devel] [PATCH 7/8] spice/gl: render DisplaySurface via opengl Gerd Hoffmann
2016-02-18  9:26 ` [Qemu-devel] [PATCH 8/8] spice/gl: create dummy primary surface (RfC) Gerd Hoffmann
2016-02-18 12:20 ` [Qemu-devel] [PATCH 0/8] spice: add opengl/virgl/dmabuf support Marc-André Lureau

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=1455787610-31787-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.