summaryrefslogtreecommitdiff
path: root/Xi/xiselectev.c
AgeCommit message (Collapse)AuthorFilesLines
2009-09-03Xi: if XISetEventMask fails, return this to the client.Peter Hutterer1-1/+3
The only failure point can be a BadAlloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: fix broken swap code in XISelectEvents request processing.Peter Hutterer1-1/+1
The pointer advanced 12 bytes too short. Rather unfortunate if both the code and the test have the same bug. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: Unify checking for invalid bits in grab masks.Peter Hutterer1-10/+23
Bits above XI2LASTEVENT are invalid and cause in BadValues. These checks must be performed anywhere where a mask_len parameter is given. This patch also adds the missing checks to grab masks. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: extra length checking for requests providing masks.Peter Hutterer1-0/+11
masks can be of arbitrary length. If the client did not initialize mask_len, some sort of boundary check is needed to avoid running over memory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15Update to type-specific raw events - require inputproto 1.9.99.14.Peter Hutterer1-0/+12
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14Xi: use byte-counting macros instead of manual calculation.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-23Xi: fix up access modes for calls to dixLookupDevice().Eamon Walsh1-4/+4
New access modes are being passed to the device access hook for XI2: DixCreateAccess for creating a new master device; DixAdd/RemoveAccess for attaching/removing slave devices to a master; and DixListProp/GetProp/SetPropAccess for device properties. Refer to the XACE-Spec document in xorg-docs, section "Device Access." Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-18input: bump to ints for deviceids - XI2 requires 16-bit deviceids.Peter Hutterer1-6/+0
Note: ABI break, but ABI_XINPUT_VERSION has NOT been bumped. Recompile input drivers. Revert "Xi: return BadImplementation for deviceids 256 and above" This reverts commit 2b459f44f3edaea137df9a28bc7adfeb1b9f1df7. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-14Xi: XISelectEvents/XIGetSelectedEvents use 'win' instead of 'window' now.Peter Hutterer1-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11Xi: store mask_len before swapping in ProcXIGetSelectedEvents.Peter Hutterer1-4/+3
Swapping the mask_len and then advancing the pointer by the swapped length is just a bad idea. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11Xi: correct return buffer size for XIGetSelectedEvents.Peter Hutterer1-1/+1
The maximum number of bytes is calculated by the mask len, and the mask len is always in 4-byte units. XI2MASKSIZE however is in bytes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11Xi: XIGetSelectedEvents mustn't returned masks from non-existing devices.Peter Hutterer1-0/+9
Or devices the client doesn't have XACE permissions for. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11Xi: ProcXIGetSelectedEvents must use WriteToClient for swapped data.Peter Hutterer1-4/+1
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-11input: remove dependency on XI2 protocol for XI_LASTEVENT.Peter Hutterer1-2/+2
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-11Xi: rename ProcXISelectEvent to ProcXISelectEvents.Peter Hutterer1-3/+3
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-11Xi: start checking for invalid mask bits _after_ LASTEVENT.Peter Hutterer1-2/+2
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-11Xi: XISelectEvents returns BadValue for num_masks == 0.Peter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11Xi: XISelectEvents needs to be at least size 3, not exactly.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-09Xi: return BadValue for XI_HierarchyChangd mask on devices.Peter Hutterer1-0/+7
This mask may only be selected for XIAllDevices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-05Xi: return BadImplementation for deviceids 256 and abovePeter Hutterer1-0/+6
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-05-25Xi: add request processing for XIGetSelectedEvents.Peter Hutterer1-0/+116
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-25Xi: advance by the right number of bytes when trawling XI2 event masks.Peter Hutterer1-0/+2
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-16Update to new XI2 namesPeter Hutterer1-8/+8
2009-05-08input: update to inputproto 1.9.99.8 XI2 defines.Peter Hutterer1-3/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19Xi: remove fail from SProcXISelectEvent.Peter Hutterer1-2/+1
Leftover from rebasing once too often, I guess. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20Allow XI2 event selection for AllDevices and AllMasterDevices.Peter Hutterer1-1/+8
2009-03-20Add XI2 masks and XISelectEvent() request handling.Peter Hutterer1-0/+121
XI2 event masks are simply stored in the OtherEventMasks as a separate field. This replaces the XiSelectEvent code.