summaryrefslogtreecommitdiff
path: root/include/inputstr.h
AgeCommit message (Collapse)AuthorFilesLines
2008-10-13Xi: check all handlers before applying property changes.Peter Hutterer1-1/+2
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-09-26Xi: add "deletable" flag to properties, add DeleteProperty handler.Peter Hutterer1-0/+3
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-5/+5
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-11/+1
This removes all the meta-information about device properties (pending, fromClient, range, valid_values, immutable).
2008-07-24Shape extension is built-in and mandatory.Adam Jackson1-2/+0
2008-07-13Add support for multiple pointer acceleration schemes. #8583Simon Thum1-2/+12
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-10/+19
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-1/+40
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-40/+1
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-1/+40
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-1/+1
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-0/+3
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-05-26input: change dxremaind, dyremaind to floats for better acceleration #9156Simon Thum1-1/+1
X.Org Bug 9156 <http://bugs.freedesktop.org/show_bug.cgi?id=9156> Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-26dix: Allocate MD's motion history to be large enough for potential valuatorsPeter Hutterer1-3/+3
Since we can't predict how many valuators may be in a future SD attached to an MD, we need to preallocate a history buffer that is large enough to keep MAX_VALUATORS coordinates per event. In addition, the history buffer needs to memorize the coordinate ranges at the time, thus requiring MDs to store (min_val, max_val, current_val, time) instead of (current_val, time) for each motion history entry. This commit only fixes the allocation.
2008-05-25Remove GetMotionProc from ValuatorClassRec.Peter Hutterer1-2/+1
With the MD/SD device hierarchy we need control over the generation of the motion history as well as the conversion later before posting it to the client. So let's not let the drivers change it. No x.org driver currently uses it anyway, linuxwacom doesn't either so dumping it seems safe enough.
2008-05-23dix: more device scaling insanity.Peter Hutterer1-0/+2
Assuming master->last.valuators is in screen coords, SD's are always in device coordinates. 1. If an event comes in, scale masters->last to the device, drop into device's last->valuators. 2. Apply motion from the actual event 3. Scale back to screen coords, check if we may need to cross screens 4. Drop screen coords into master->last 5. Rescale to device coords, drop into deviceValuator event and SD->last 6. Drop screen coords into ev->root_x/y Whoopee...
2008-05-23input: instead of lastx/y, use a last.valuators[] array on the device.Peter Hutterer1-2/+7
During GetPointerEvents (and others), we need to access the last coordinates posted for this device from the driver (not as posted to the client!). Lastx/y is ok if we only have two axes, but with more complex devices we also need to transition between all other axes. ABI break, recompile your input drivers.
2008-04-29Xi: apply ValuatorEvent data to the device's valuators.Peter Hutterer1-1/+1
After UpdateDeviceState, the device has the current position in absolute coordinates, the event has the correct valuator data to be delivered to the client.
2008-01-09Xi: keep a counter of buttons down to avoid duplicate press/release events.Peter Hutterer1-1/+1
If two devices are attached to the same master device, pressing button 1 on each of them leads to two button presses from the same device. Some apps really don't like that. So we just put a counter in place and only send the first press and the last release.
2008-01-03Merge branch 'master' into mpxPeter Hutterer1-2/+3
Conflicts: XTrap/xtrapddmi.c Xext/security.c Xext/xprint.c Xext/xtest.c Xext/xvdisp.c Xi/exevents.c Xi/grabdevb.c Xi/grabdevk.c Xi/opendev.c Xi/ungrdev.c Xi/ungrdevb.c Xi/ungrdevk.c dix/cursor.c dix/devices.c dix/dixutils.c dix/events.c dix/getevents.c dix/main.c dix/window.c hw/xfree86/ramdac/xf86Cursor.c include/dix.h include/input.h include/inputstr.h mi/midispcur.c mi/miinitext.c mi/misprite.c render/animcur.c xfixes/cursor.c xkb/xkbAccessX.c
2007-11-22DeviceIntRec: move lastx/lasty from valuator into DeviceIntRec.Peter Hutterer1-2/+2
We free the ValuatorClassRec quite regularly. If a SIGIO is handled while we're swapping device classes, we can bring the server down when we try to access lastx/lasty of the master device.
2007-11-15dix: Add FreeDeviceClass and FreeFeedbackClass for centralised xfree.Peter Hutterer1-0/+16
Ensures that we only have one way of freeing a device class to avoid leaks in ChangeMasterDeviceClasses and other places.
2007-11-08Merge branch 'mpx' into mdsdPeter Hutterer1-0/+1
Conflicts: Xi/opendev.c
2007-11-07Merge branch 'master' into mpxPeter Hutterer1-0/+1
Conflicts: Xi/extinit.c Xi/grabdev.c Xi/setmode.c Xi/ungrdev.c dix/devices.c dix/events.c dix/getevents.c include/dix.h mi/midispcur.c mi/misprite.c xkb/xkbActions.c xkb/xkbEvents.c xkb/xkbPrKeyEv.c
2007-10-16include: add "lastSlave" field to DeviceIntRec.Peter Hutterer1-0/+3
Set to the last slave device that routed events through the master.
2007-10-16include: add "isMaster" field to DeviceIntRec.Peter Hutterer1-2/+4
Set to TRUE for master devices. Also fixing up comment for paired field in spriteInfo, will be set bidirectional from now on.
2007-10-16include: add "master" field to DeviceIntRec.Peter Hutterer1-0/+1
"master" points to the device this device is attached to. Event sent by the device will also be routed through the master. master and spriteOwner are mutually exclusive.
2007-09-19Merge branch 'master' into XACE-SELINUXEamon Walsh1-0/+1
Conflicts: afb/afbpntwin.c afb/afbscrinit.c afb/afbwindow.c cfb/cfb.h cfb/cfballpriv.c cfb/cfbscrinit.c cfb/cfbwindow.c configure.ac fb/wfbrename.h hw/xfree86/xf4bpp/ppcIO.c hw/xfree86/xf4bpp/ppcPntWin.c hw/xfree86/xf4bpp/ppcWindow.c hw/xfree86/xf8_32bpp/cfbscrinit.c mfb/mfb.h mfb/mfbpntwin.c mfb/mfbscrinit.c mfb/mfbwindow.c mi/miexpose.c Note: conflicts caused by devPrivates rework vs. paintwindow changes.
2007-09-05Fix key repeats during VT switch.Daniel Stone1-0/+1
Add keyc->postdown, which represents the key state as of the last mieqEnqueue call, and use it when we need to know the posted state, instead of the processed state (keyc->down). Add small functions to getevents.c to query and modify key state in postdown and use them all through, eliminating previously broken uses.
2007-08-28devPrivates rework: since API is already broken, switch everythingEamon Walsh1-2/+3
over to new system. Need to update documentation and address some remaining vestiges of old system such as CursorRec structure, fb "offman" structure, and FontRec privates.
2007-08-12Merge branch 'master' into mpxPeter Hutterer1-0/+1
Conflicts: Xi/exevents.c dix/devices.c dix/getevents.c include/dix.h mi/mieq.c
2007-08-01Hotplug: Add HAL supportDaniel Stone1-0/+1
Add support for HAL-based hotplugging, in which we just get the list of input devices and properties from HAL. Requires an FDI which is not yet in mainline HAL.
2007-07-06Use the same struct for generic event masks throughout the code.Peter Hutterer1-7/+2
Renaming those structs too. Previously grabs were using a different struct than windows, which was reasonably stupid.
2007-06-19Add implicitGrab field to GrabInfoRec.Peter Hutterer1-2/+4
Is set when passive grab is implicit as result of a ButtonPress event. If this is the case, we need to store the XI mask as well as the core mask to ensure delivery of XI events during the grab's lifetime. Remove all core grabs on other devices when client issues a GrabPointer or GrabKeyboard request. Let's assume that the client really only wants one device to interact, so this seems like a reasonable solution.
2007-05-31Add a deviceMask to the GrabRec and don't interfere with passiveGrabs.Peter Hutterer1-0/+4
This quickfixes event delivery problems with XI events when a grab was on. deviceMask is only used when the grab was from a ButtonPress to preserve potential XI event masks. This is not an ideal solution but it works until I have time to work on PassiveGrabs.
2007-05-14Remove double-grab option. We only want one grab per device.Peter Hutterer1-2/+1
2007-05-14Add ExtendedGrabDevice handling.Peter Hutterer1-0/+17
Add XGE handling in DeliverGrabbedEvent. We can now grab something selecting XGE events, but the current code is a bit messy and doesn't work too well yet.
2007-04-26Enable event delivery for multiple heads.Paulo Ricardo Zanoni1-0/+12
Requires moving the spriteTrace into the DeviceIntRec and adjusting a few functions to take in device argument, most notably XYToWindow(). Cursor rendering on the second screen is busted.
2007-04-17Change FocusIn/Out semantics to match Enter/Leave semantics.Peter Hutterer1-1/+0
2007-04-02Merge branch 'master' into mpxPeter Hutterer1-1/+1
Conflicts: Xi/closedev.c Xi/exevents.c Xi/extinit.c Xi/listdev.c dix/window.c hw/xfree86/common/xf86Xinput.c include/extinit.h mi/mipointer.c
2007-03-25Static cleanups, dead code deletion.Adam Jackson1-1/+1
2007-03-25Clean up DeviceIntPtr, prepare for Server 1.4 ABI. Move sprite-relatedPeter Hutterer1-7/+10
information into a new SpriteInfoRec, remove isMPDev flag.
2007-03-08dix: Each device needs to differ between a core grab and an XI grab,Peter Hutterer1-19/+23
otherwise a Xi grab may overwrite or release a core grab. Replace grab and associates with coreGrab and deviceGrab structures, adjust rest of dix/Xi/etc to compile. xfree86: Don't check for core devices, we'll have the virtual ones anyway. If we check, the first mouse device is duplicated and sends double events.
2007-03-01dix: Remove InitSprite, work can be done by InitializeSprite.Peter Hutterer1-1/+1
Free sprite struct if a spriteOwner is paired. xfree86: Use PairDevices instead of passing booleans around when creating a sprite. Xext: Switch back to using LookupPointer/KeyboardDevice instead of inputInfo.xyz.
2007-01-29Xi: Adding ChangePointerKeyboardPairing requestPeter Hutterer1-1/+6
Adding PointerKeyboardPairingChanged event Correct error values for XWarpDevicePointer dix: Adding device argument to SendMappingNotify Adding spriteOwner flag to devices
2006-12-18mi: removing MPX ifdefsPeter Hutterer1-0/+1
global sprite renaming in mipointer and misprite fixed: multiple remove cursor call in miSpriteInstallColormap fixed: wrong core pointer usage in miSpriteStoreColors dix: bugfix in CheckCursorConfinement removing MPX ifdefs removing MPX event generation (using Xi solely now) bugfix GrabDevice: uninitialized field in grab struct caused segfault xfree86: removing MPX fdefs Xi: removing MPX protocol events
2006-12-11dix: Moving SpriteRec into DeviceIntRecPeter Hutterer1-2/+26
removing global sprite structure beginning to remove MPX ifdefs xnest: Fix to make xnest compile again
2006-11-23mi: closing memory leak, miPointer is freed in miPointerCloseScreenPeter Hutterer1-1/+1
bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX adding DeviceIntPtr parameter to ScreenRec's cursor functions. cleanup of miPointer code to use same scheme in each function dix: MPHasCursor() function determines checking whether to invoke cursor rendering. animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies on the core pointer right now. xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on the core pointer right now. rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on the core pointer right now. ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on the core pointer right now.
2006-11-17dix: moved isMPdev field to end of _DeviceIntRec structurePeter Hutterer1-3/+3
mi: added miMPPointers array to mipointer.c added DeviceIntPtr to all miPointerSpriteFuncs. Coming from miPointer we use inputInfo.pointer as standard value. ABI BREAK! ramdac: forcing failed HW Cursor initialisation. MPX needs software rendering. changes to use new miPointerSpriteFunc (this required externing inputInfo, should probably be fixed at a later point). RAC: changes to use new miPointerSpriteFuncs.