summaryrefslogtreecommitdiff
path: root/Xi
AgeCommit message (Collapse)AuthorFilesLines
2009-09-27Xi: CopyKeyClass is not static for XQuartzJeremy Huddleston1-1/+1
2009-09-27Xi: update axisVals with the right subpixel data.Peter Hutterer1-1/+1
Subpixel data in data_frac is stored as FP32.32, hence we need to get that down again before adding it to the current value. Reported-by: Thomas Jaeger Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 9bd08c690fc687c4d69bb70536f3079a9184476d)
2009-09-26Xi: fix length calculation for ValuatorState in QueryDeviceState reply.Peter Hutterer1-1/+1
The length field needs to include the bytes required for the valuators (INT32) as well. The reply length has the right value and since the valuator state is always last, clients didn't notice the wrong offset. Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 6ee796e9bb4e46782b50a69c7b4fa5b49576f139)
2009-09-22input: don't use typecasts to access members of InternalEvent.Peter Hutterer1-2/+2
To avoid confusion, the member names are now postfixed with _event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-21input: define server-supported protocol versions in one single file.Peter Hutterer1-5/+5
include/protocol-versions.h specifies each extension version as supported by the server and sent back on the wire to the client. This fixes up several issues with the server potentially reporting a higher version of the protocol if recompiled against a newer version of the protocol. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: RĂ©mi Cardona <remi@gentoo.org> Acked-by: Julien Cristau <jcristau@debian.org>
2009-09-04input: allow for detectable autorepeat.Daniel Stone1-1/+2
For core and XI1 events, store the key_repeat flag in the sequence number until TryClientEvents. The sequenceNumber is unset until TryClientEvents. [Also thrown in, some random indentation changes. Thanks] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: return BadDevice for master kbds and attached slaves in XIWarpPointerPeter Hutterer1-0/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: return error values to client from XIWarpPointer.Peter Hutterer1-0/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: standardise XI2 headers.Peter Hutterer7-8/+33
Adding missing dix-config.h include, adding one missing header guard. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: if XISetEventMask fails, return this to the client.Peter Hutterer2-3/+8
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 Hutterer3-19/+31
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: don't overrun memory for grab masks.Peter Hutterer2-2/+6
A grab mask provided in the request may be larger than the one used in the server. Cut down to size before memcopying. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03Xi: don't try to set oversized or non-existing masks.Peter Hutterer1-3/+6
Fixes crash if the first XISelectEvents has a zero sized event mask. Fixes crash if the mask provided is larger than others->xi2mask[]. 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-09-01Input: Mark Xi input events as criticalDaniel Stone1-0/+5
Note that the Xi events are critical and should thus cause a flush to the client when an input event is pending. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-09-01Xi: Fix harmless ButtonPress/ButtonRelease confusionDaniel Stone1-0/+1
A missing break meant that ButtonPress would fall through into ButtonRelease, but luckily it appears to have been completely harmless. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-08-31Xi: silence compiler warning "type may be used uninitialized"Peter Hutterer1-2/+2
GrabKey and GrabButton are only called from XI/XI2 code. Set type to -1, just in case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27Xext: rename Xtst* to XTest*Peter Hutterer2-34/+34
This patch corrects a misnaming of XTest-related functions. The extension itself announces itself as XTEST. Xtst is the library name itself, but all library functions are prefixed by XTest. Same with the naming in the server. - Rename all *Xtst* functions to *XTest* for consistency with the library and in-server API. - Rename the "Xtst device" property to "XTEST device" for consistency with the extension naming. - Rename the device naming to "<master device name> XTEST device". The default xtest devices become "Virtual core XTEST pointer" and "Virtual core XTEST keyboard". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-25Xi: fix XIWarpPointer up for FP3232 as input coordinates.Peter Hutterer1-10/+17
requires inputproto 1.9.99.902 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-25Xi: fix swapping for XIWarpPointer and XIChangeCursor requests.Peter Hutterer2-0/+12
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24input: move CorePointer/KeyboardProc declarations into header.Peter Hutterer1-4/+0
The extern declaration in xichangehierarchy.c was broken anyway. This fixes a crash on creating a new master device. Reported-by: Maxim Levitsky Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24Xi: add swapping hook for XIGetFocus reply.Peter Hutterer3-0/+13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24Xi: correct length field for XIQueryPointer reply.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24Xi: allow XIQueryPointer requests for master pointers and floating slaves.Peter Hutterer1-10/+19
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24Xi: fix swapping for XIQueryPointer request/reply handling.Peter Hutterer1-2/+14
buttons_size is necessary as WriteToClient swaps the buttons_len field, resulting in the wrong number of bytes being written later. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24Xi: return deviceid as error value in XIQueryPointer.Peter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24Xi: return BadDevice for changing device cursors on non-master pointers.Peter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17dix: rework DeviceChangedEvents a bit.Peter Hutterer1-9/+17
DCEs are now processed when sent throught the master device, not when sent through the slave device. This includes a removal of some un-used (or partly used) fields in the DCE itself to something more self-explanatory. TODO: if a device has events queued and its attachment is changed, the DCE is silently dropped now. Instead, it should be generated as soon as the first event after the attachment is sent. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17input: move DeviceChangedEvent conversion into eventconvert.cPeter Hutterer1-118/+5
The version in eventconvert.c was half broken and for some reason we ended up with a second version in exevents.c (which works). Move it over to where it belongs and call EventToXI2 instad of having a custom function for it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13Xi: fix up broken DeviceChangedEvent swapping codePeter Hutterer1-13/+20
2009-08-13Xi: add event swapping for XIRawEvents.Peter Hutterer1-0/+49
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13Xi: fix event swapping for XIDeviceEvents.Peter Hutterer1-5/+13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13Xi: un-statify XI2EventSwap, it is needed for tests.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13Xi: get device changed data from DeviceChangedEvents, not the device (#23100)Peter Hutterer1-3/+66
If a new device posts an event while the DCE is in the queue, getting the data from the device may result in invalid memory access. X.Org Bug 23100 <http://bugs.freedesktop.org/show_bug.cgi?id=23100>
2009-08-05dix: require PointerProc and KeyboardProc to be passed into AllocDevicePair.Peter Hutterer1-1/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30Xi: set the sourceid for focus devices to the device id.Peter Hutterer1-1/+1
Unlike Enter/Leave events generated by a device pushing the pointer around, a device doesn't change focus all by itself. It's a result of a SetInputFocus call, a window becoming unviewable or a grab activating. As such, the sourceid for focus events is always the deviceid itself. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30input: switch internal event types to enums.Peter Hutterer1-0/+6
Use enum EventType instead of ints. This requires a load of default cases in various switch statements to silence compiler warnings. Reported-by: Aaron Plattner Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30Xi: remove FIXME and obsolete include.Peter Hutterer1-1/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30Xi: remove obsolete comment.Peter Hutterer1-1/+1
XI1 only uses 7 bits for deviceids, bit 8 is used for the MORE_EVENTS flag on the wire (when DeviceValuator events are required). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30include: untangle events.h from the SDK headers.Peter Hutterer1-0/+1
InternalEvents shouldn't be used anywhere outside the X server itself. Split up into events.h for opaque typedefs for the events needed by various headers and eventstr.h for the actual struct definitions. eventstr.h must only be included by code that requires internal events and is not part of the SDK. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22input: remove XI2 keysym grabs, use keycode grabs instead.Peter Hutterer1-4/+4
Keysym grabs are tricky in the details, keycode grabs are known to work. So for now, provide keycode grabs only. Requires inputproto 1.9.99.15. 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 Hutterer2-1/+17
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14Xi: use byte-counting macros instead of manual calculation.Peter Hutterer28-55/+56
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-12input: include effective modifiers in device events.Peter Hutterer1-0/+4
Require inputproto 1.9.99.13 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-01dix: introduce "Xtst Device" label property.Peter Hutterer1-0/+1
Xtst devices get this property assigned automatically so they can be detected easily by a client. The property is read-only. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-01input: store the master device's ID in the devPrivate for XTest devices.Peter Hutterer1-60/+24
Rather than storing a simple boolean in the devPrivate for XTest devices, store the actual master device's id (since it is constant for the life of the device anyway). Callers should use GetXtstDevice now instead of digging around in the devPrivates themselves. This patch allows for a cleanup in the creation of new master devices since GetMaster and GetXtstDevice spare the need for loops, IsPointer checks and similar. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com>
2009-07-01input: abstract Xtst device lookupPeter Hutterer1-23/+5
The callers should need to use the dev privates key to look up xtest devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com>
2009-06-23Xi: check for GetAttr permission when listing or querying devices.Eamon Walsh2-52/+83
If the check fails, leave the device off the returned list of info structures. Under XI2, this may cause inconsistent views of the device topology after a change (for example, devices disappearing from view, or showing as attached to a master that cannot be seen). More work is needed to deal with topology changes and device relabeling. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-23Xi: check for Use permission on the device in SetClientPointer().Eamon Walsh1-2/+3
Presumably, some intelligent, XI2-aware management app will be calling XISetClientPointer on behalf of other clients; this check makes sure the target client has permission on the device. Requires changing the prototype to return status code instead of Bool. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>