mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
e0c64d08d1
commit
0753609458
4 changed files with 29 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue