diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-12 13:38:34 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-16 13:28:17 +1000 |
commit | 772e0f9159ca3ab8fb4e03ed6feee3cc93697724 (patch) | |
tree | 43721047867a1f063cacecf80b927a6318021abc /dix | |
parent | 58f3127919ba5fcb3bb467b6913c28ee1127c82b (diff) |
dix: Don't set core events in SetMaskForEvent.
Rather, modify the two callers to call separately for the two different.
events. Unexport SetMaskForEvent too.
And while we're at it, get rid of the MotionFilter macro, because it's one
half confusing and one half pointless.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/events.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/dix/events.c b/dix/events.c index 598dc7514..ae566c539 100644 --- a/dix/events.c +++ b/dix/events.c @@ -190,13 +190,6 @@ typedef const char *string; * See DeliverEventsToWindow(). */ #define ImplicitGrabMask (1 << 7) -/* - * The following relies on the fact that the Button<n>MotionMasks are equal - * to the corresponding Button<n>Masks from the current modifier/button state. - */ -#define Motion_Filter(class) (PointerMotionMask | \ - (class)->state | (class)->motionMask) - #define WID(w) ((w) ? ((w)->drawable.id) : 0) @@ -571,20 +564,26 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev, #endif /* PANORAMIX */ +/** + * Modifies the filter for the given protocol event type to the given masks. + * + * There's only two callers: UpdateDeviceState() and XI's SetMaskForExtEvent(). + * The latter initialises masks for the matching XI events, it's a once-off + * setting. + * UDS however changes the mask for MotionNotify and DeviceMotionNotify each + * time a button is pressed to include the matching ButtonXMotion mask in the + * filter. + * + * @param[in] deviceid The device to modify the filter for. + * @param[in] mask The new filter mask. + * @param[in] event Protocol event type. + */ void SetMaskForEvent(int deviceid, Mask mask, int event) { - int coretype; if (deviceid < 0 || deviceid > MAXDEVICES) FatalError("SetMaskForEvent: bogus device id"); - if ((event < LASTEvent) || (event >= 128)) - FatalError("SetMaskForEvent: bogus event number"); filters[deviceid][event] = mask; - - /* Need to change the mask for the core events too */ - coretype = XItoCoreType(event); - if (coretype) - filters[deviceid][coretype] = mask; } void @@ -4618,6 +4617,8 @@ InitEvents(void) inputInfo.keyboard = (DeviceIntPtr)NULL; inputInfo.pointer = (DeviceIntPtr)NULL; lastEventMask = OwnerGrabButtonMask; + /* The mask for pointer motion events may have changed in the last server + * generation. See comment above definition of filters. */ filters[0][PointerMotionMask] = MotionNotify; for (i = 1; i < MAXDEVICES; i++) { |