summaryrefslogtreecommitdiff
path: root/include/inputstr.h
AgeCommit message (Collapse)AuthorFilesLines
2009-02-25include: fix indentation for lastSlave/master.Peter Hutterer1-2/+2
Yeah! Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23dix: convert passive grabs to use internal events.Peter Hutterer1-2/+1
deviceGrab.sync.event is now an internal event, and CheckDeviceGrabs and friends is changed over. Note that this currently breaks some frozen grabs. See towards the end of ComputeFreezes(). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23dix: fix EnqueueEvent to work with internal events.Peter Hutterer1-3/+2
Note that we're only partially switched to internal events. The event in the devices' event queue (dev->deviceGrab.sync.event) is still an XI event. The events in syncEvents are InternalEvents only now. This also implies fixing CheckVirtualMotion to work with internal events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-13Document the event masks.Peter Hutterer1-8/+50
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03dix: add SetBit(arr, bit) and ClearBit(arr, bit) to include/inputstr.hPeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Add postdown to ButtonClassRecDaniel Stone1-0/+1
This mirrors that in KeyClassRec: the state of the buttons as posted to GetPointerEvents, rather than the state of the buttons as processed by ProcessOtherEvent and friends. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Remove core keysyms from KeyClassRecDaniel Stone1-1/+0
Instead of always keeping two copies of the keymap, only generate the core keymap from the XKB keymap when we really need to, and use the XKB keymap as the canonical keymap. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Remove modifierMap from coreDaniel Stone1-2/+1
We already have modmap (in the exact same format!) in XKB, so just use that all the time, instead of duplicating the information. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Remove modifierKeyMapDaniel Stone1-2/+0
Since modifierKeyMap is generated from modifierMap, just remove it, and only generate it when we need to send the modifier map to the client. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Remove state from KeyClassRecDaniel Stone1-2/+0
We already have state fully stored within XKB, so instead of duplicating it, just generate the values to send to clients when required. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22XKB: Make XKB mandatoryDaniel Stone1-20/+0
No more #ifdef XKB, because you can't disable the build, and no more noXkbExtension either. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-20dix: Remove traces of CoreDevicePrivateKeyPeter Hutterer1-2/+0
Obsolete with MPX. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-16Count the number of logically down buttons in buttonsDownThomas Jaeger1-1/+5
This fixes the following bug. Assuming your window manager grabs Alt+Button1 to move windows, map Button3 to 0 via XSetPointerMapping, then press the physical button 3 (this shouldn't have any effect), press Alt and then button 1. The press event is delivered to the application instead of firing the grab. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-2/+2
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
2008-12-02Xi: fix use of button->down - bitflags instead of int arrays.Peter Hutterer1-3/+0
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>
2008-10-31Move MAX_DEVICES to misc.h, rename to MAXDEVICES for consistency.Peter Hutterer1-3/+1
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.