xinput: Remove PropagateMask

Initialized to a constant value, never modified, never varied by device.

Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2018-04-19 14:49:22 -04:00 committed by Adam Jackson
parent 4520ec9bd5
commit 5684d436e2
3 changed files with 14 additions and 40 deletions

View File

@ -746,9 +746,8 @@ UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state,
{
Mask mask;
mask = DevicePointerMotionMask | state | motion_mask;
SetMaskForEvent(device->id, mask, DeviceMotionNotify);
mask = PointerMotionMask | state | motion_mask;
SetMaskForEvent(device->id, mask, DeviceMotionNotify);
SetMaskForEvent(device->id, mask, MotionNotify);
}
@ -2522,6 +2521,12 @@ FreeInputMask(OtherInputMasks ** imask)
*imask = NULL;
}
#define XIPropagateMask (KeyPressMask | \
KeyReleaseMask | \
ButtonPressMask | \
ButtonReleaseMask | \
PointerMotionMask)
void
RecalculateDeviceDeliverableEvents(WindowPtr pWin)
{
@ -2548,7 +2553,7 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin)
inputMasks->deliverableEvents[i] |=
(wOtherInputMasks(tmp)->deliverableEvents[i]
& ~inputMasks->dontPropagateMask[i] &
PropagateMask[i]);
XIPropagateMask);
}
if (pChild->firstChild) {
pChild = pChild->firstChild;
@ -2961,7 +2966,7 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
{
struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin);
if (mask & ~PropagateMask[maskndx]) {
if (mask & ~XIPropagateMask) {
client->errorValue = mask;
return BadValue;
}

View File

@ -44,7 +44,6 @@ extern int DeviceBusy;
extern int BadClass;
/* Note: only the ones needed in files other than extinit.c are declared */
extern const Mask DevicePointerMotionMask;
extern const Mask DevicePointerMotionHintMask;
extern const Mask DeviceFocusChangeMask;
extern const Mask DeviceStateNotifyMask;
@ -56,8 +55,6 @@ extern const Mask DevicePresenceNotifyMask;
extern const Mask DevicePropertyNotifyMask;
extern const Mask XIAllMasks;
extern Mask PropagateMask[];
extern int DeviceValuator;
extern int DeviceKeyPress;
extern int DeviceKeyRelease;

View File

@ -129,13 +129,8 @@ SOFTWARE.
* breaks down. The device needs the dev->button->motionMask. If DBMM is
* the same as BMM, we can ensure that both core and device events can be
* delivered, without the need for extra structures in the DeviceIntRec. */
const Mask DeviceKeyPressMask = KeyPressMask;
const Mask DeviceKeyReleaseMask = KeyReleaseMask;
const Mask DeviceButtonPressMask = ButtonPressMask;
const Mask DeviceButtonReleaseMask = ButtonReleaseMask;
const Mask DeviceProximityMask = (1L << 4);
const Mask DeviceStateNotifyMask = (1L << 5);
const Mask DevicePointerMotionMask = PointerMotionMask;
const Mask DevicePointerMotionHintMask = PointerMotionHintMask;
const Mask DeviceButton1MotionMask = Button1MotionMask;
const Mask DeviceButton2MotionMask = Button2MotionMask;
@ -363,8 +358,6 @@ RESTYPE RT_INPUTCLIENT;
extern XExtensionVersion XIVersion;
Mask PropagateMask[EMASKSIZE];
/*****************************************************************
*
* Versioning support
@ -914,22 +907,6 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
}
}
/**************************************************************************
*
* Allow the specified event to have its propagation suppressed.
* The default is to not allow suppression of propagation.
*
*/
static void
AllowPropagateSuppress(Mask mask)
{
int i;
for (i = 0; i < MAXDEVICES; i++)
PropagateMask[i] |= mask;
}
/**************************************************************************
*
* Record an event mask where there is no unique corresponding event type.
@ -1011,20 +988,16 @@ FixExtensionEvents(ExtensionEntry * extEntry)
DeviceBusy += extEntry->errorBase;
BadClass += extEntry->errorBase;
SetMaskForExtEvent(DeviceKeyPressMask, DeviceKeyPress);
AllowPropagateSuppress(DeviceKeyPressMask);
SetMaskForExtEvent(KeyPressMask, DeviceKeyPress);
SetCriticalEvent(DeviceKeyPress);
SetMaskForExtEvent(DeviceKeyReleaseMask, DeviceKeyRelease);
AllowPropagateSuppress(DeviceKeyReleaseMask);
SetMaskForExtEvent(KeyReleaseMask, DeviceKeyRelease);
SetCriticalEvent(DeviceKeyRelease);
SetMaskForExtEvent(DeviceButtonPressMask, DeviceButtonPress);
AllowPropagateSuppress(DeviceButtonPressMask);
SetMaskForExtEvent(ButtonPressMask, DeviceButtonPress);
SetCriticalEvent(DeviceButtonPress);
SetMaskForExtEvent(DeviceButtonReleaseMask, DeviceButtonRelease);
AllowPropagateSuppress(DeviceButtonReleaseMask);
SetMaskForExtEvent(ButtonReleaseMask, DeviceButtonRelease);
SetCriticalEvent(DeviceButtonRelease);
SetMaskForExtEvent(DeviceProximityMask, ProximityIn);
@ -1032,8 +1005,7 @@ FixExtensionEvents(ExtensionEntry * extEntry)
SetMaskForExtEvent(DeviceStateNotifyMask, DeviceStateNotify);
SetMaskForExtEvent(DevicePointerMotionMask, DeviceMotionNotify);
AllowPropagateSuppress(DevicePointerMotionMask);
SetMaskForExtEvent(PointerMotionMask, DeviceMotionNotify);
SetCriticalEvent(DeviceMotionNotify);
SetEventInfo(DevicePointerMotionHintMask, _devicePointerMotionHint);