summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPovilas Kanapickas <povilas@radix.lt>2020-10-10 02:51:34 +0300
committerPeter Hutterer <peter.hutterer@who-t.net>2020-11-25 04:20:22 +0000
commitf6e0bf68333f7edb02e3b937bc164f6591da2320 (patch)
treea234e2c152871861948a3efbcc843ea6129b4d5c /Xi
parent56d720592155c55617728e8ddf1ba8192fe5d46c (diff)
downloadxserver-f6e0bf68333f7edb02e3b937bc164f6591da2320.tar.gz
Xi: Make check_for_touch_selection_conflicts() more generic
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xiselectev.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 0498e0188..0266a8d30 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -44,7 +44,9 @@
* - If A has XIAllMasterDevices, B may select on XIAllDevices
* - if A has device X, B may select on XIAllDevices/XIAllMasterDevices
*/
-static int check_for_touch_selection_conflicts(ClientPtr B, WindowPtr win, int deviceid)
+static int
+check_for_touch_selection_conflicts(ClientPtr B, WindowPtr win, int deviceid,
+ int evtype)
{
OtherInputMasks *inputMasks = wOtherInputMasks(win);
InputClients *A = NULL;
@@ -67,19 +69,19 @@ static int check_for_touch_selection_conflicts(ClientPtr B, WindowPtr win, int d
return BadImplementation; /* this shouldn't happen */
/* A has XIAllDevices */
- if (xi2mask_isset_for_device(A->xi2mask, inputInfo.all_devices, XI_TouchBegin)) {
+ if (xi2mask_isset_for_device(A->xi2mask, inputInfo.all_devices, evtype)) {
if (deviceid == XIAllDevices)
return BadAccess;
}
/* A has XIAllMasterDevices */
- if (xi2mask_isset_for_device(A->xi2mask, inputInfo.all_master_devices, XI_TouchBegin)) {
+ if (xi2mask_isset_for_device(A->xi2mask, inputInfo.all_master_devices, evtype)) {
if (deviceid == XIAllMasterDevices)
return BadAccess;
}
/* A has this device */
- if (xi2mask_isset_for_device(A->xi2mask, tmp, XI_TouchBegin))
+ if (xi2mask_isset_for_device(A->xi2mask, tmp, evtype))
return BadAccess;
}
@@ -230,7 +232,8 @@ ProcXISelectEvents(ClientPtr client)
if (BitIsOn(bits, XI_TouchBegin)) {
rc = check_for_touch_selection_conflicts(client,
win,
- evmask->deviceid);
+ evmask->deviceid,
+ XI_TouchBegin);
if (rc != Success)
return rc;
}