summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-02-08 13:29:14 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-02-14 09:10:58 +1000
commit678d64aa2e929368b6d6f2b83bbf5540c4fa292d (patch)
tree5f29532867a9e03a480a073d77b18888adc2deb2 /Xi
parentfede384962edd175b1a2ce6edd8d2ef9b0fd74f0 (diff)
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 <michel.daenzer@amd.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xibarriers.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index d0be70135..1926762ad 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -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);
}