summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2009-07-22Check if new space was actually allocated before freeing.Pierre Willenbrock1-3/+8
There will be no new space allocated, if mode != PropModeReplace and len == 0, or if mode is not one of the handled modes. This fixes freeing data that is still in use, leading to double frees and other memory corruption. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22input: remove XI2 keysym grabs, use keycode grabs instead.Peter Hutterer2-4/+1
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-19dix: xserver "make dist" fails due to eventconvert.h (#27825)Gaetan Nadon1-1/+0
This header file is not in the /dix dir, but in the /include dir. The makefile aborted and the xserver distribution files were not created. The fix is to remove this header file from the libdix_la_SOURCES in the dix/Makefile.am. X.Org Bug 27825 <http://bugs.freedesktop.org/show_bug.cgi?id=27825> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-17Revert "Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty:"Oliver McFadden1-4/+0
This reverts commit 7333dc2969f60af0abcfb28e7182a5fff9918223. False positive.
2009-07-16Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty:Oliver McFadden1-0/+4
Event alloc_arg: Called allocation function "XIPropToInt" on "ptr" [details] 167 rc = XIPropToInt(val, &nelem, &ptr); Event leaked_storage: Variable "ptr" goes out of scope
2009-07-15xserver: remove unused code in clipValuatorsÉric Piel1-2/+1
The axes variables was never used, remove it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15Update to xextproto 7.0.99.1.Peter Hutterer1-2/+1
xextproto had Xlib client headers moved into libXext. Protocol header files are named fooproto.h, header files with constants foo.h or fooconst.h where foo.h was already in use for client-side headers.
2009-07-15dix: fix wrong raw valuator copyPeter Hutterer1-3/+2
internal events keep valuator data at the index for the valuator, not like the wire events that start with first_valuator. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15dix: use sizeof(FP3232) instead of 2 * sizeof(int32_t).Peter Hutterer1-2/+2
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 Hutterer3-10/+27
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14dix: switch to byte-counting functions.Peter Hutterer9-53/+54
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14dix: don't send presence events for attaching/detaching slave devices.Peter Hutterer1-13/+0
The code that didn't list attached slave devices for XI1 clients doesn't exist anymore, so there's no need for these presence events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-12dix: Remove temporary detachment of slave devices.Peter Hutterer1-66/+0
Previously, an active grab on an attached slave device would send the device floating for the duration of the grab. This breaks existing XI applications (e.g. the GIMP) since they grab all devices automatically - resulting in the loss of control over the VCP. The behaviour of extended input devices during a grab in relation to the core pointer is not specified in the XI protocol specification. The removal of the temporary detachment restores the behaviour of extended input devices as present in currently released servers - even if a device is grabbed, an event from this device will result in an event from the core pointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-12input: include effective modifiers in device events.Peter Hutterer1-0/+2
Require inputproto 1.9.99.13 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-06dix: always init the full button map to default values (#22594)Peter Hutterer1-0/+2
Master devices must have the standard button map applied for all buttons to ensure buttons larger than 7 (the default for MDs) are mapped appropriately. We can't copy the button map from SDs to MDs since that breaks the chained button mapping. However, by ensuring all buttons (even non-existing ones) are mapped, devices that send such buttons continue to work. X.Org Bug 22594 <http://bugs.freedesktop.org/show_bug.cgi?id=22594> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-03Fix IsXtstDevice - returns false positives since 0814f511d5.Peter Hutterer1-2/+9
Missing check for the value of 'mid' returned false positives if master was NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-01dix: introduce "Xtst Device" label property.Peter Hutterer1-0/+25
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-7/+35
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-0/+13
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-07-01dix: set the client's error value to the bad deviceid in check_butmap_change.Peter Hutterer1-0/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-30dix/property.c: use memcpy where appropriate.Eamon Walsh1-11/+6
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-29dix: report subpixel coordinates for high-resolution devicesThomas Jaeger1-29/+63
Acked-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-29dix: rename pDev->dev, pVel->vel for consistencySimon Thum1-164/+165
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-29dix: improve pointer acceleration APISimon Thum1-26/+40
This makes the ptr accel api actually sensible from a driver perspective, since it avoids superfluous device lookups. Also, makes independent accel contexts possible. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-26xace: add a new hook for checking property content after it has been set.Eamon Walsh1-10/+22
Allows security modules to enforce what property contents can be set by clients. Uses the new DixPostAccess bit to distinguish between the existing call made during the lookup (with the old property data) and this new call. Note that this only applies to writes, prepends, or appends to existing properties; for new properties the existing DixCreateAccess hook call may be used since it includes the new data. Refer to the XACE-Spec document in xorg-docs, section "Property Access." Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-23Xi: check for Use permission on the device in SetClientPointer().Eamon Walsh1-4/+8
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>
2009-06-24dix/resource: fix use after free in resource code with DRIDave Airlie1-4/+8
LookupClientResourceComplex is used by DRI1 code to find and free a DRI drawable in a callback, however when the DRI code returns this->value is now pointing at freed memory. It seemed easiest to store the value to a temporary and return it afterwards. Another option might be a new FreeClientResourceComplex or one that also returns the id, so we can free it using an alternative means. found using valgrind. amended along ajax's suggestions
2009-06-24dix: update a commentThomas Jaeger1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-24dix: do away with an instance of temporary in-place modificationThomas Jaeger1-10/+9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-24dix: deal with first_valuator > 0 correctly if POINTER_SCREEN is setThomas Jaeger1-5/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-23Xi: Remove redundant and incorrect butmap range checkBen Gamari1-6/+0
Maps are CARD8s, therefore checking for values above 255 is completely unnecessary. Moreover, 0 is a valid value for maps, so the check wasn't even correct to begin with. This fixes bug #22392, which was uncovered by commit 280b7f92d729ec910ffa3d18dce7bbc215be7a3c. Signed-off-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-22dix: fix wrong indices in set_valuator.Peter Hutterer1-2/+2
Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-18input: unify button numbers on master devices.Peter Hutterer1-0/+79
Master devices provide the union of all attached slave devices' buttons, i.e. the number of buttons on the master device is always the number of buttons of the slave device with the highest number of buttons. When slaves are attached or detached, the master device adjusts the button number to reflect the new buttons. On a slave switch, this slave's button labels are copied into the master (up to slave->num_buttons). The remaining button labels (if any) stay as they are. Thus, if any of the higher buttons is still pressed, it reflects the label of the last pressed device that provided this button. If two devices press the same button and it is differently labelled the last pressed one will be reflected in the master device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-18dix: reduce MDs and xtest pointers to 7 buttons by default.Peter Hutterer1-1/+1
MD's will soon be the union of all devices anyway. XTest pointers are only for the core protocol XTest stuff, so 7 buttons (lmr + 4 wheel buttons) should do. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-18input: Add labels to buttons and valuators - ABI_XINPUT_VERSION 7Peter Hutterer2-13/+34
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-18input: bump to ints for deviceids - XI2 requires 16-bit deviceids.Peter Hutterer1-2/+2
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-18input: change axisVal from uint to double.Peter Hutterer1-2/+2
With subpixel support, uint just doesn't cut it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-17Xi: Add support for sourceid in the device classes.Peter Hutterer1-0/+5
2009-06-17Xi: namespace XI2 files.Peter Hutterer2-3/+3
Some files (notably those merged with MPX before XI2 came along) didn't use a 'xi' prefix. This patch changes all of them to meaningful names. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-12input: remove un-used "setter" argument from SetClientPointer.Peter Hutterer1-3/+2
It's obsolete, not likely to come back, let's drop it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11input: remove dependency on XI2 protocol for XI_LASTEVENT.Peter Hutterer1-0/+1
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-10input: move inputstr.h to where its needed.Dave Airlie1-0/+1
This stops inputstr.h being needed to be included by output drivers. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-07dix: protect against missing ButtonClasses in GetPointerMapping.Peter Hutterer1-2/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-07dix: set the generic event type for implicit XI2 grabs.Peter Hutterer1-0/+3
event->type is always GenericEvent for XI2 events. Instead, XI_ButtonPress (the generic event's evtype must be stored. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-07dix: suppress pointer acceleration on xtest devicesSimon Thum1-3/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-07dix: prefer lroundf() over roundf() in axis scalingSimon Thum1-1/+1
it's unclear whether there actually is a problem, but in a very similar case there is (bug#21456). Also, integer addition is generally faster. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-04xace: fix a bad send access hook call.Eamon Walsh1-1/+1
2009-06-04Merge branch 'master' into xi2Peter Hutterer1-4/+0
2009-06-03s/MIN/min/, s/MAX/max/ (#2968)Adam Jackson1-4/+0
2009-06-03dix: set the device state for XI valuator events.Peter Hutterer1-0/+12
Valuator events need to include the device's state, while other device events need to include the state of the core devices. Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>