[Spice-commits] Branch '0.8' - server/red_dispatcher.c
Alon Levy
alon at kemper.freedesktop.org
Sun Jul 31 07:51:08 PDT 2011
server/red_dispatcher.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 13e38cdba6177ba6640fb4eaf1b58e0b3355ae5d
Author: Alon Levy <alevy at redhat.com>
Date: Sun Jul 31 16:35:41 2011 +0300
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.
diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index 1dfb551..f74b13e 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -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) {
More information about the Spice-commits
mailing list