Commit Graph

16 Commits

Author SHA1 Message Date
Peter Hutterer
22b4ac44e4 Xi: XIGetSelectedEvents mustn't returned masks from non-existing devices.
Or devices the client doesn't have XACE permissions for.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11 13:42:49 +10:00
Peter Hutterer
7868956b0f Xi: ProcXIGetSelectedEvents must use WriteToClient for swapped data.
The data is already swapped before, so we just post it to the client as-is,
without attempting to swap it again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11 13:42:49 +10:00
Peter Hutterer
aa2babf11c input: remove dependency on XI2 protocol for XI_LASTEVENT.
inputstr includes XI2proto.h for the sole purpose of XI_LASTEVENT.
However, using XI_LASTEVENT in the server is prone to errors, if the server
is recompiled against a newer version of the protocol it would bump this
variable and associates bits, including potential ABI.

This patch defines an XI2LASTEVENT for use in the server and removes the
XI2proto.h require. XI2LASTEVENT is the current value of XI_LASTEVENT.

This patch is required by components that require access to inputInfo
(currently xf86-video-geode and xf86-video-cirrus) but should not have a
require for the XI2 protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11 13:42:49 +10:00
Peter Hutterer
77cc816da4 Xi: rename ProcXISelectEvent to ProcXISelectEvents.
The request name has the plural, so let's do it here too. Purely cosmetic
change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11 13:42:49 +10:00
Peter Hutterer
9563feeeb5 Xi: start checking for invalid mask bits _after_ LASTEVENT.
Two issues that combined to false positives and false negatives.
- The checking for invalid bits must be performed when there are enough bits
that an event outside of LASTEVENT may be selected.
- The first invalid bit is LASTEVENT + 1, not LASTEVENT.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11 13:39:48 +10:00
Peter Hutterer
e2fbaebb87 Xi: XISelectEvents returns BadValue for num_masks == 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11 13:39:48 +10:00
Peter Hutterer
cfeb65ac45 Xi: XISelectEvents needs to be at least size 3, not exactly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11 13:39:48 +10:00
Peter Hutterer
0e66a443a0 Xi: return BadValue for XI_HierarchyChangd mask on devices.
This mask may only be selected for XIAllDevices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-09 10:34:30 +10:00
Peter Hutterer
2b459f44f3 Xi: return BadImplementation for deviceids 256 and above
The protocol allows for 16 bit device ids, but the implementation doesn't
yet. We need to break the input ABI once more to shift the DeviceIntRec's
CARD8 to a CARD16, along with some changes in the privates.

Once that is done, revert this patch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-05 16:09:09 +10:00
Peter Hutterer
53e821ab4a Xi: add request processing for XIGetSelectedEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-25 14:58:12 +10:00
Peter Hutterer
b377994336 Xi: advance by the right number of bytes when trawling XI2 event masks.
The wire layout is  [struct xXIEventMask][mask bytes]. So the pointer needs
to not only be advanced by the mask bytes, but also by the size of the
struct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-25 14:58:08 +10:00
Peter Hutterer
8ff1bff8f4 Update to new XI2 names 2009-05-16 12:20:58 +10:00
Peter Hutterer
bae070914f input: update to inputproto 1.9.99.8 XI2 defines.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:44 +10:00
Peter Hutterer
ca4918ac2f Xi: remove fail from SProcXISelectEvent.
Leftover from rebasing once too often, I guess.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:18:15 +10:00
Peter Hutterer
97e89a5957 Allow XI2 event selection for AllDevices and AllMasterDevices. 2009-03-20 15:17:55 +10:00
Peter Hutterer
8b6a370058 Add XI2 masks and XISelectEvent() request handling.
XI2 event masks are simply stored in the OtherEventMasks as a separate field.
This replaces the XiSelectEvent code.
2009-03-20 15:17:55 +10:00