Commit 5684d436 authored by Adam Jackson's avatar Adam Jackson 💣 Committed by Adam Jackson

xinput: Remove PropagateMask

Initialized to a constant value, never modified, never varied by device.
Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent 4520ec9b
...@@ -746,9 +746,8 @@ UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state, ...@@ -746,9 +746,8 @@ UpdateDeviceMotionMask(DeviceIntPtr device, unsigned short state,
{ {
Mask mask; Mask mask;
mask = DevicePointerMotionMask | state | motion_mask;
SetMaskForEvent(device->id, mask, DeviceMotionNotify);
mask = PointerMotionMask | state | motion_mask; mask = PointerMotionMask | state | motion_mask;
SetMaskForEvent(device->id, mask, DeviceMotionNotify);
SetMaskForEvent(device->id, mask, MotionNotify); SetMaskForEvent(device->id, mask, MotionNotify);
} }
...@@ -2522,6 +2521,12 @@ FreeInputMask(OtherInputMasks ** imask) ...@@ -2522,6 +2521,12 @@ FreeInputMask(OtherInputMasks ** imask)
*imask = NULL; *imask = NULL;
} }
#define XIPropagateMask (KeyPressMask | \
KeyReleaseMask | \
ButtonPressMask | \
ButtonReleaseMask | \
PointerMotionMask)
void void
RecalculateDeviceDeliverableEvents(WindowPtr pWin) RecalculateDeviceDeliverableEvents(WindowPtr pWin)
{ {
...@@ -2548,7 +2553,7 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin) ...@@ -2548,7 +2553,7 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin)
inputMasks->deliverableEvents[i] |= inputMasks->deliverableEvents[i] |=
(wOtherInputMasks(tmp)->deliverableEvents[i] (wOtherInputMasks(tmp)->deliverableEvents[i]
& ~inputMasks->dontPropagateMask[i] & & ~inputMasks->dontPropagateMask[i] &
PropagateMask[i]); XIPropagateMask);
} }
if (pChild->firstChild) { if (pChild->firstChild) {
pChild = pChild->firstChild; pChild = pChild->firstChild;
...@@ -2961,7 +2966,7 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask, ...@@ -2961,7 +2966,7 @@ DeviceEventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask,
{ {
struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin); struct _OtherInputMasks *inputMasks = wOtherInputMasks(pWin);
if (mask & ~PropagateMask[maskndx]) { if (mask & ~XIPropagateMask) {
client->errorValue = mask; client->errorValue = mask;
return BadValue; return BadValue;
} }
......
...@@ -44,7 +44,6 @@ extern int DeviceBusy; ...@@ -44,7 +44,6 @@ extern int DeviceBusy;
extern int BadClass; extern int BadClass;
/* Note: only the ones needed in files other than extinit.c are declared */ /* Note: only the ones needed in files other than extinit.c are declared */
extern const Mask DevicePointerMotionMask;
extern const Mask DevicePointerMotionHintMask; extern const Mask DevicePointerMotionHintMask;
extern const Mask DeviceFocusChangeMask; extern const Mask DeviceFocusChangeMask;
extern const Mask DeviceStateNotifyMask; extern const Mask DeviceStateNotifyMask;
...@@ -56,8 +55,6 @@ extern const Mask DevicePresenceNotifyMask; ...@@ -56,8 +55,6 @@ extern const Mask DevicePresenceNotifyMask;
extern const Mask DevicePropertyNotifyMask; extern const Mask DevicePropertyNotifyMask;
extern const Mask XIAllMasks; extern const Mask XIAllMasks;
extern Mask PropagateMask[];
extern int DeviceValuator; extern int DeviceValuator;
extern int DeviceKeyPress; extern int DeviceKeyPress;
extern int DeviceKeyRelease; extern int DeviceKeyRelease;
......
...@@ -129,13 +129,8 @@ SOFTWARE. ...@@ -129,13 +129,8 @@ SOFTWARE.
* breaks down. The device needs the dev->button->motionMask. If DBMM is * 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 * 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. */ * 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 DeviceProximityMask = (1L << 4);
const Mask DeviceStateNotifyMask = (1L << 5); const Mask DeviceStateNotifyMask = (1L << 5);
const Mask DevicePointerMotionMask = PointerMotionMask;
const Mask DevicePointerMotionHintMask = PointerMotionHintMask; const Mask DevicePointerMotionHintMask = PointerMotionHintMask;
const Mask DeviceButton1MotionMask = Button1MotionMask; const Mask DeviceButton1MotionMask = Button1MotionMask;
const Mask DeviceButton2MotionMask = Button2MotionMask; const Mask DeviceButton2MotionMask = Button2MotionMask;
...@@ -363,8 +358,6 @@ RESTYPE RT_INPUTCLIENT; ...@@ -363,8 +358,6 @@ RESTYPE RT_INPUTCLIENT;
extern XExtensionVersion XIVersion; extern XExtensionVersion XIVersion;
Mask PropagateMask[EMASKSIZE];
/***************************************************************** /*****************************************************************
* *
* Versioning support * Versioning support
...@@ -914,22 +907,6 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to) ...@@ -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. * Record an event mask where there is no unique corresponding event type.
...@@ -1011,20 +988,16 @@ FixExtensionEvents(ExtensionEntry * extEntry) ...@@ -1011,20 +988,16 @@ FixExtensionEvents(ExtensionEntry * extEntry)
DeviceBusy += extEntry->errorBase; DeviceBusy += extEntry->errorBase;
BadClass += extEntry->errorBase; BadClass += extEntry->errorBase;
SetMaskForExtEvent(DeviceKeyPressMask, DeviceKeyPress); SetMaskForExtEvent(KeyPressMask, DeviceKeyPress);
AllowPropagateSuppress(DeviceKeyPressMask);
SetCriticalEvent(DeviceKeyPress); SetCriticalEvent(DeviceKeyPress);
SetMaskForExtEvent(DeviceKeyReleaseMask, DeviceKeyRelease); SetMaskForExtEvent(KeyReleaseMask, DeviceKeyRelease);
AllowPropagateSuppress(DeviceKeyReleaseMask);
SetCriticalEvent(DeviceKeyRelease); SetCriticalEvent(DeviceKeyRelease);
SetMaskForExtEvent(DeviceButtonPressMask, DeviceButtonPress); SetMaskForExtEvent(ButtonPressMask, DeviceButtonPress);
AllowPropagateSuppress(DeviceButtonPressMask);
SetCriticalEvent(DeviceButtonPress); SetCriticalEvent(DeviceButtonPress);
SetMaskForExtEvent(DeviceButtonReleaseMask, DeviceButtonRelease); SetMaskForExtEvent(ButtonReleaseMask, DeviceButtonRelease);
AllowPropagateSuppress(DeviceButtonReleaseMask);
SetCriticalEvent(DeviceButtonRelease); SetCriticalEvent(DeviceButtonRelease);
SetMaskForExtEvent(DeviceProximityMask, ProximityIn); SetMaskForExtEvent(DeviceProximityMask, ProximityIn);
...@@ -1032,8 +1005,7 @@ FixExtensionEvents(ExtensionEntry * extEntry) ...@@ -1032,8 +1005,7 @@ FixExtensionEvents(ExtensionEntry * extEntry)
SetMaskForExtEvent(DeviceStateNotifyMask, DeviceStateNotify); SetMaskForExtEvent(DeviceStateNotifyMask, DeviceStateNotify);
SetMaskForExtEvent(DevicePointerMotionMask, DeviceMotionNotify); SetMaskForExtEvent(PointerMotionMask, DeviceMotionNotify);
AllowPropagateSuppress(DevicePointerMotionMask);
SetCriticalEvent(DeviceMotionNotify); SetCriticalEvent(DeviceMotionNotify);
SetEventInfo(DevicePointerMotionHintMask, _devicePointerMotionHint); SetEventInfo(DevicePointerMotionHintMask, _devicePointerMotionHint);
......
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