diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2011-04-27 15:50:32 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-05-03 15:35:48 +0200 |
commit | 075360945860ad9bdd491921954b383bf762b0e5 (patch) | |
tree | ac1107ff6143abcb443c7810aca478f68000d302 /ui | |
parent | e0c64d08d11736dcea7c5a6373e3e7f62db51d9e (diff) | |
download | qemu-075360945860ad9bdd491921954b383bf762b0e5.zip qemu-075360945860ad9bdd491921954b383bf762b0e5.tar.gz qemu-075360945860ad9bdd491921954b383bf762b0e5.tar.bz2 |
spice: don't call displaystate callbacks from spice server context.
This patch moves the displaystate callback calls for setting the cursor
and the mouse pointer from spice server to qemu (iothread) context.
This allows us to simplify locking.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/spice-display.c | 12 | ||||
-rw-r--r-- | ui/spice-display.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c index d56dcfc..8579bfd 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -254,6 +254,16 @@ void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd) ssd->update = qemu_spice_create_update(ssd); ssd->notify++; } + if (ssd->cursor) { + ssd->ds->cursor_define(ssd->cursor); + cursor_put(ssd->cursor); + ssd->cursor = NULL; + } + if (ssd->mouse_x != -1 && ssd->mouse_y != -1) { + ssd->ds->mouse_set(ssd->mouse_x, ssd->mouse_y, 1); + ssd->mouse_x = -1; + ssd->mouse_y = -1; + } qemu_mutex_unlock(&ssd->lock); if (ssd->notify) { @@ -409,6 +419,8 @@ void qemu_spice_display_init(DisplayState *ds) assert(sdpy.ds == NULL); sdpy.ds = ds; qemu_mutex_init(&sdpy.lock); + sdpy.mouse_x = -1; + sdpy.mouse_y = -1; sdpy.bufsize = (16 * 1024 * 1024); sdpy.buf = qemu_malloc(sdpy.bufsize); register_displaychangelistener(ds, &display_listener); diff --git a/ui/spice-display.h b/ui/spice-display.h index e0cc46e..2f95f68 100644 --- a/ui/spice-display.h +++ b/ui/spice-display.h @@ -20,6 +20,7 @@ #include <spice/qxl_dev.h> #include "qemu-thread.h" +#include "console.h" #include "pflib.h" #define NUM_MEMSLOTS 8 @@ -55,6 +56,8 @@ struct SimpleSpiceDisplay { */ QemuMutex lock; SimpleSpiceUpdate *update; + QEMUCursor *cursor; + int mouse_x, mouse_y; }; struct SimpleSpiceUpdate { |