summaryrefslogtreecommitdiff
path: root/dix/devices.c
AgeCommit message (Collapse)AuthorFilesLines
2009-06-29dix: ensure Activate/DeactivateGrab has a valid value.Peter Hutterer1-0/+2
Xephyr doesn't manually set Activate/DeactivateGrab for new devices, resulting in a NULL-pointer dereference later when a grab is activated. Avoid the segfault by ensuring that the pointer is always valid. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 6f9e22049862ee9ac7f604411d005d8bb1b2dd1c) Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30Don't alter device button maps in DoSetPointerMappingThomas Jaeger1-23/+9
Currently, if a device map differs from the core pointer map, then the request may return MappingBusy, even though all the affected core buttons are in the up state. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 3d549438c29004d78032ecc50ab45ca0e3f49623)
2009-01-30Xi: fix use of button->down - bitflags instead of int arrays.Peter Hutterer1-1/+1
The device's button down state array was changed to use DOWN_LENGTH and thus bitflags for each button in cfcb3da7. Update the DBSN events to copy this bit-wise state. Update xkb and Xi to check for the bit flag instead of the array value. Reported by ajax. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> (cherry picked from commit a85f0d6b98237d8a196de624207acf1983a1859a)
2009-01-11Let the DDX decide on the XkbRulesDefaults.Peter Hutterer1-1/+0
Rather than assuming rules in the CoreKeyboardProc, init the default rules in InitCoreDevices, then re-use them later. In the xfree86 DDX, set the rules to "base" or "evdev", depending on whether we'll load kbd or evdev. If we create a new MD, use pc105,us as default and re-use the rules file used previously. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-09xfree86: If an input device failed to activate, return immediately.Peter Hutterer1-0/+2
Devices are only activated once - right after they've been added to the server. If a device failes activation, it's dead. There's no reason to continue. Return the error code from ActivateDevice() without setting up sprite information or even sending a event to the client. Then - in the DDX - just remove the device again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 27011254c4de4e573a0851bf46892fb488db6522)
2008-12-01input: don't switch MDs' classes around between SDs.Peter Hutterer1-20/+0
Server 1.6 uses the X Input 1.x input model, where the core devices (VCP and VCK) do not generate XI events. They don't have to swap device classes but instead stay at the default number of classes at all times. This means we can get rid of the DeviceClassesChangedEvents as well.
2008-11-26dix: Enable core devices in InitCoreDevices already.Peter Hutterer1-17/+6
Updated patch, see http://lists.freedesktop.org/archives/xorg/2008-November/040540.html Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-11-26Revert "dix: Enable core devices in InitCoreDevices already."Peter Hutterer1-8/+21
I merged the wrong patch. See correct patch at: http://lists.freedesktop.org/archives/xorg/2008-November/040540.html Not activating the device before attempting to enable it would leave the sprite unset, crashing the server when enabling the real devices. This reverts commit e078901a4eca02bd3e7a80d9462dafbca939a187. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-25dix: updated enter/leave core event model.Peter Hutterer1-1/+3
As proposed by Owen Taylor [1], the enter-leave event model needs to adjust the events sent to each window depending on the presence of pointers in a window, or in a subwindow. The new model can be summarised as: - if the pointer moves into or out of a window that has a pointer in a child window, the events are modified to appear as if the pointer was moved out of or into this child window. - if the pointer moves into or out of a window that has a pointer in a parent window, the events are modified to appear as if the pointer was moved out of or into this parent window. Note that this model requires CoreEnterLeaveEvent and DeviceEnterLeaveEvent to be split and treated separately. [1] http://lists.freedesktop.org/archives/xorg/2008-August/037606.html Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-24dix: Enable core devices in InitCoreDevices already.Peter Hutterer1-21/+8
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-11-24dix: fix false comment.Peter Hutterer1-2/+0
VCP and VCK are always present, this comment is a leftover from earlier MPX days. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-21dix: fix typos in comments, one formatting fix.Simon Thum1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-10-31dix: FreeDeviceClass() and friends can be static.Peter Hutterer1-23/+25
2008-10-31dix: remove unused GuessFreePointerDevice().Peter Hutterer1-40/+0
Not used since the MD/SD hierarchy was introduced many moons ago.
2008-10-31dix: NextFreePointerDevice() can be static.Peter Hutterer1-11/+14
2008-10-31dix: PairDevices() can be static, remove from input.Peter Hutterer1-32/+32
PairDevices() is only ever called in EnableDevice().
2008-10-31Move MAX_DEVICES to misc.h, rename to MAXDEVICES for consistency.Peter Hutterer1-8/+8
2008-10-23dix: fix two more endian issues, correct initial "enabled" value. #18111Peter Hutterer1-3/+7
EnableDevice and DisableDevice both change the property too. And enabled must be set to FALSE in AddInputDevice, the device is not enabled yet. X.Org Bug 18111 <https://bugs.freedesktop.org/show_bug.cgi?id=18111>
2008-10-23dix: don't allow VCP/VCK be disabled through properties.Peter Hutterer1-0/+5
2008-10-23dix: fix endianess issue in AddInputDevice. #18111Peter Hutterer1-1/+3
dev->enabled is a Bool. Bool is two bytes. BOOL on the other hand is a protocol type and always 1 byte. So copy the value into the one-byte type before passing it into XIChangeDeviceProperty. Found by Michel Dänzer. X.Org Bug 18111 <http://bugs.freedesktop.org/show_bug.cgi?id=18111>
2008-10-13Xi: check all handlers before applying property changes.Peter Hutterer1-5/+9
The current code exposes to inconsistent updates, i.e. if handler N succeeds but handler N+1 fails in setting the property, an error is returned to the client although parts of the server now behave as if the property change succeeded. This patch adds a "checkonly" parameter to the SetProperty handler. The handlers are then called twice, once with checkonly set to TRUE. On the checkonly run, handlers _MUST_ return error codes if the property cannot be applied. Handlers are not permitted to actually apply the changes. On the second run, handlers are permitted to apply property changes. Errors codes returned on the second run are ignored.
2008-10-10dix: silence "unused variable" compiler warning.Peter Hutterer1-1/+0
2008-10-06xalloc+memset(0) -> xcallocAdam Jackson1-44/+2
2008-10-06xalloc+bzero -> xcallocAdam Jackson1-24/+4
2008-10-03dix: fix non-initialization of pointer accel in master devices.Simon Thum1-2/+7
Init MDs always with PtrAccelNoOp. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-09-26Push server-known properties into xserver-properties.h.Peter Hutterer1-0/+1
2008-09-26Xi: add "deletable" flag to properties, add DeleteProperty handler.Peter Hutterer1-1/+2
A property can only be deleted if any of the following is true: - if a property is deletable and all handlers return Success. - if a property is non-deleteable and the all handlers return Success AND the delete request does not come from a client (i.e. driver or the server). A client can never delete a non-deletable property.
2008-09-26Xi: allow Set/GetProperties to return a status, and honour this status code.Peter Hutterer1-4/+3
If a property handler now bails out, return the error code to the caller. This allows to be slightly more specific with the errors.
2008-09-26Xi: remove configure/query device property calls.Peter Hutterer1-4/+3
This removes all the meta-information about device properties (pending, fromClient, range, valid_values, immutable).
2008-09-18dix: calloc, not malloc, ValuatorClassRec.Peter Hutterer1-1/+1
For master devices, the ptraccel code could segfault on free since we'd be dereferencing random memory. Callocing the valuatorClassRec is the easy fix.
2008-08-28Prepare for array-index based devPrivates.Tomas Carnecky1-2/+4
TODO: static indices can be made just an int; some indices can be combined.
2008-08-12dix: remove superfluous check.Peter Hutterer1-3/+0
2008-08-08dix: SetModifierMapping should only apply to the ClientPointer and it's SDs.Peter Hutterer1-1/+2
2008-07-28dix: rename classic accel _scheme_ to lightweight to avoid confusion withSimon Thum1-3/+10
classic accel _profile_ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-22dix: reset potential lastSlaves when disabling an SDKeith Packard1-0/+8
Unplug a mouse, then warp the pointer and the warp pointer code will try to update the position of the last slave device associated with the master. That pointer will be stale and the X server will crash. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-21dix: shift the duplicate button mapping check to ProcSetPointerMapping.Peter Hutterer1-9/+19
XI 2 allows two buttons to have the same button code.
2008-07-13Xi: expose Enable/DisableDevice through XI_PROP_ENABLED property.Peter Hutterer1-0/+39
2008-07-13Add support for multiple pointer acceleration schemes. #8583Simon Thum1-2/+59
Available acceleration schemes: - xorg classic scheme. - the new "Predictable" polynomial accel scheme. X.Org Bug 8583 <http://bugs.freedesktop.org/show_bug.cgi?id=8583> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-10Xi: pack the property stuff into a struct, make handlers a linked list.Peter Hutterer1-4/+3
We may need more than one handler to deal with a property (e.g. one in the driver, one in the DIX), so get the handlers into a linked list and call them one-by-one. This is of course slightly less entertaining than the hilarious WRAP/UNWRAP game we play in other parts of the server. XIRegisterPropertyHandler/XIUnregisterPropertyHandler are the interface drivers/the DIX should use to attach themselves to the device. XIDeleteAllDeviceProperties destroys everything, including the handlers.
2008-07-10Xi: add support for input device properties.Peter Hutterer1-0/+9
Basically just copied from randr properties, with minor changes only. Each device supports arbitrary properties that can be modified by clients. Modifications to the properties are passed to the driver (if applicable) and can then affect the configuration of the device. Note that device properties are limited to a specific device. A property set on a slave device does not migrate to the master.
2008-07-10Revert "Xi: add support for input device properties."Peter Hutterer1-9/+0
Note to self: don't mix up branches with half-finished cherrypicks. This reverts commit 666838fcc8b71fdeae160844160187f345cbf4a6.
2008-07-10Xi: add support for input device properties.Peter Hutterer1-0/+9
Basically just copied from randr properties, with minor changes only. Each device supports arbitrary properties that can be modified by clients. Modifications to the properties are passed to the driver (if applicable) and can then affect the configuration of the device. Note that device properties are limited to a specific device. A property set on a slave device does not migrate to the master.
2008-06-26input: for non-device events (e.g. DevicePresence) use MAX_DEVICES as id.Peter Hutterer1-3/+4
Using id = 0 only worked pre-MPX since XInput didn't allow XOpenDevice for the core devices (0 and 1). Now we can now legally register for events so we may overwrite our device-independent classes with the ones selected for the VCP. So, increase the EMASKSIZE to MAX_DEVICES + 1 and use MAX_DEVICES as the ID when we don't have a device.
2008-06-19Make button down state a bitmask. Master buttons track union of slave buttonsKeith Packard1-1/+1
Mixing usage where some parts of the code treated this field as a bitmask and other parts as an array of card8 was wrong, and as the wire protocol wanted bitmasks, it was less invasive to switch the newer counting code use booleans. Master devices track slave buttons by waiting for all slave buttons to be released before delivering the release event to the client. This also removes the state merging code in DeepCopyDeviceClasses -- that code was changing master device state without delivering any events, violating protocol invariants. The result will be that existing slave button state which does not match the master will not be visible through the master device. Fixing this would require that we synthesize events in this function, which seems like a bad idea. Note that keyboards have the same issue. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-06-18input: fix up usage of button->down, used to be a bitmask, is now an array.Peter Hutterer1-1/+1
device->button->down used to be a 32-byte bitmask with one bit for each button. This has changed into a 256-byte array, with one byte assigned for each button. Some of the callers were still using this array as a bitmask however, this is fixed with this patch. Thanks to Keith Packard for pointing this out. See also: http://lists.freedesktop.org/archives/xorg/2008-June/036202.html
2008-06-13Fix "warning: implicit declaration of function ‘miPointerGetScreen’".Eamon Walsh1-0/+1
2008-06-05dix: set dst->mapWidth when allocating a new map.Peter Hutterer1-0/+1
2008-06-02xkb: delete default rules when devices are closed.Peter Hutterer1-0/+3
We only have one set of default rules options in xkb. When the second keyboard is brought up with Xkb options specified, these new options overwrite the old. In future server generations, the rules used for the VCK are a mixture of the default ones and ones previously specified for other keyboards. Simply resetting the xkb default rules to NULL avoids this issue. Reproducable by setting XkbLayout "de" and XkbVariant "nodeadkeys". In the second server generation, the VCK has "us(nodeadkeys)". This again produces a SIGABRT when the first key is hit. I could not figure out why the SIGABRT happens. This patch is avoiding the issue rather than fixing it.
2008-05-31dix: null out dummyDev, otherwise Xephyr dereferences random pointers.Peter Hutterer1-1/+2
SendEventToAllWindow eventually causes a IsInterferingGrab(), which attempts to dereference dev->deviceGrab.grab.
2008-05-26If core motion history is required, scale back to screen coords and INT16.Peter Hutterer1-6/+3