From f6e0bf68333f7edb02e3b937bc164f6591da2320 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Sat, 10 Oct 2020 02:51:34 +0300 Subject: [PATCH] Xi: Make check_for_touch_selection_conflicts() more generic --- Xi/xiselectev.c | 13 ++++++++----- 1 file 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; }