mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-01 04:45:37 +00:00
server/red_dispatcher: fix wrong resolution set for tablet
when changing resolutions due to the new async code paths the surface creation command was kept by reference, and later, when the red_worker signaled completion by calling async_complete the mouse mode was updated using the reference. This caused the wrong values to be read resulting in wrong resolutions set and a non working mouse pointer. Fix this by keeping a copy of the surface creation command instead of a reference. No bz. Found in testing.
This commit is contained in:
parent
0c8438c7ff
commit
13e38cdba6
@ -53,7 +53,7 @@ struct RedDispatcher {
|
||||
RedDispatcher *next;
|
||||
RedWorkerMessage async_message;
|
||||
pthread_mutex_t async_lock;
|
||||
QXLDevSurfaceCreate *surface_create;
|
||||
QXLDevSurfaceCreate surface_create;
|
||||
};
|
||||
|
||||
typedef struct RedWorkeState {
|
||||
@ -379,7 +379,7 @@ static void qxl_worker_destroy_primary_surface(QXLWorker *qxl_worker, uint32_t s
|
||||
|
||||
static void red_dispatcher_create_primary_surface_complete(RedDispatcher *dispatcher)
|
||||
{
|
||||
QXLDevSurfaceCreate *surface = dispatcher->surface_create;
|
||||
QXLDevSurfaceCreate *surface = &dispatcher->surface_create;
|
||||
|
||||
dispatcher->x_res = surface->width;
|
||||
dispatcher->y_res = surface->height;
|
||||
@ -387,7 +387,7 @@ static void red_dispatcher_create_primary_surface_complete(RedDispatcher *dispat
|
||||
dispatcher->primary_active = TRUE;
|
||||
|
||||
update_client_mouse_allowed();
|
||||
dispatcher->surface_create = NULL;
|
||||
memset(&dispatcher->surface_create, sizeof(QXLDevSurfaceCreate), 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -405,7 +405,7 @@ red_dispatcher_create_primary_surface(RedDispatcher *dispatcher, uint32_t surfac
|
||||
} else {
|
||||
message = RED_WORKER_MESSAGE_CREATE_PRIMARY_SURFACE;
|
||||
}
|
||||
dispatcher->surface_create = surface;
|
||||
dispatcher->surface_create = *surface;
|
||||
|
||||
write_message(dispatcher->channel, &message);
|
||||
if (async) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user