Commit 678d64aa authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Xi: lock the input thread for any pointer barrier list manipulation



The input thread checks the barriers for pointer positioning, swapping the
list out from underneath is considered impolite.
Reported-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
parent fede3849
......@@ -611,7 +611,9 @@ CreatePointerBarrierClient(ClientPtr client,
}
pbd->deviceid = dev->id;
input_lock();
xorg_list_add(&pbd->entry, &ret->per_device);
input_unlock();
}
ret->id = stuff->barrier;
......@@ -626,7 +628,9 @@ CreatePointerBarrierClient(ClientPtr client,
ret->barrier.directions &= ~(BarrierPositiveX | BarrierNegativeX);
if (barrier_is_vertical(&ret->barrier))
ret->barrier.directions &= ~(BarrierPositiveY | BarrierNegativeY);
input_lock();
xorg_list_add(&ret->entry, &cs->barriers);
input_unlock();
*client_out = ret;
return Success;
......@@ -689,7 +693,9 @@ BarrierFreeBarrier(void *data, XID id)
mieqEnqueue(dev, (InternalEvent *) &ev);
}
input_lock();
xorg_list_del(&c->entry);
input_unlock();
FreePointerBarrierClient(c);
return Success;
......@@ -709,7 +715,9 @@ static void add_master_func(void *res, XID id, void *devid)
pbd = AllocBarrierDevice();
pbd->deviceid = *deviceid;
input_lock();
xorg_list_add(&pbd->entry, &barrier->per_device);
input_unlock();
}
static void remove_master_func(void *res, XID id, void *devid)
......@@ -752,7 +760,9 @@ static void remove_master_func(void *res, XID id, void *devid)
mieqEnqueue(dev, (InternalEvent *) &ev);
}
input_lock();
xorg_list_del(&pbd->entry);
input_unlock();
free(pbd);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment