summaryrefslogtreecommitdiff
path: root/Xi
AgeCommit message (Collapse)AuthorFilesLines
2009-01-30Don't release grabs unless all buttons are upThomas Jaeger1-1/+1
Previously, only buttons <= 5 would count here, but the core protocol allows for 255 buttons. http://lists.freedesktop.org/archives/xorg/2009-January/042092.html Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 717a961528ec69a6e630d536e15568670e0b398a) Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30Count the number of logically down buttons in buttonsDownThomas Jaeger1-4/+4
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> (cherry picked from commit f7f85f696570541e2dd43462675de9e6ee46f545)
2009-01-30Xi: fix use of button->down - bitflags instead of int arrays.Peter Hutterer2-9/+4
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-12mi: force CopyKeyClass for key events. (#19048)Peter Hutterer1-1/+1
While we don't want to copy all other device classes into the VCK, we need to copy the key class to transfer the layout from the SDs into the VCK. This resembles the functionality of SwitchCoreKeyboard in server 1.5. Thanks to Colin Guthrie for providing the follow-up patch (#19222) X.Org Bug 19048 <http://bugs.freedesktop.org/show_bug.cgi?id=19048> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-16Xi: silence compiler warningPeter Hutterer1-1/+1
Don't mix declarations and statements. (cherry picked from commit fb2a8d0e59a3d187255538f6add22ec67551507a)
2008-12-16Xi: don't update VCP's valuators from DeviceValuator events #18882Peter Hutterer1-2/+6
The VCP doesn't need to update the valuators anyway since it cannot send XI events. Just skip that bit. X.Org Bug 18882 <http://bugs.freedesktop.org/show_bug.cgi?id=18882> Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09Xi: XIGetDevice needs to ignore the MORE_EVENTS flag.Tom Jaeger1-1/+1
Reported in X.Org Bug 18882, Comment 5. <http://bugs.freedesktop.org/show_bug.cgi?id=18882> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 78a62d7713c708d067d8824ec41b0a0225c1997f) Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09Xi: change XIUnRegisterPropertyHandler to XIUnregisterPropertyHandlerPeter Hutterer1-1/+1
CamelCase can be taken too far, and AFAICT there's no consumers of that function yet anyway. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-01Require inputproto 1.5Peter Hutterer1-2/+2
Also claim to now support XI 1.5. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-01Xi: Purge XGE remainders, we don't have any XGE events anymore.Peter Hutterer1-37/+0
2008-12-01input: don't switch MDs' classes around between SDs.Peter Hutterer2-97/+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-12-01dix: No DeviceEnterLeave events in server 1.6Peter Hutterer2-45/+0
2008-12-01Xi: don't allow VCP/VCK be OpenDevice'd, but allow all SDs.Peter Hutterer1-9/+2
Reverting to traditional XI behaviour.
2008-12-01Xi: don't list attachment in ListInputDevices, but list all SDs.Peter Hutterer1-34/+0
In XI2, we only list the VCP and the VCK as well as floating SDs to non-XI2 clients. This is not the case here, we just list all devices. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-01Xi: remove the GetExtensionVersion hack - don't reply with supported version.Peter Hutterer1-13/+0
XI2 abuses the GEV request to reply with the min/major version of the supported extension if the length for the name is 0. Don't do that, yet. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-01Xi: remove all new XI2 protocol requests and their handling.Peter Hutterer18-1646/+4
This commit reverts to XI 1.4 requests, plus the input device property requests. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-04xkb: extract the correct device in XkbFilterEvents.Peter Hutterer1-0/+32
If the event is an XI event, we need to work on the correct device, not on the VCK. Adds XIGetDevice(event) function to extract the device from an event.
2008-11-04Purge device-based WindowAccess code.Peter Hutterer6-374/+8
Really, this was a bad idea. It's not security, the UI features that would have been cool (e.g. clicking through windows) aren't implemented anyway, and there's nothing you can't achieve just by using plain XI anyway. Requires inputproto 1.9.99.6.
2008-10-31Move EXTENSION_BASE and EXTENSION_EVENT_BASE to misc.h.Peter Hutterer1-1/+0
2008-10-31Move MAX_DEVICES to misc.h, rename to MAXDEVICES for consistency.Peter Hutterer2-8/+8
2008-10-26Nuke unused variablesJulien Cristau1-1/+0
2008-10-13Xi: check all handlers before applying property changes.Peter Hutterer1-12/+22
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-10Xi: don't memcpy the KeyClassRec from SD to MD. #16167Peter Hutterer1-2/+0
Most of its component get copied during CopyKeyClass anyway. The ones that aren't: postdown - never changed for virtual devices anyway. down - shouldn't change that without sending events. memcpy'ing the struct also copied mapWidth, which means we didn't realloc during SetKeySymsMap lateron, overwriting the memory assigned to us. X.Org Bug 16167 <http://bugs.freedesktop.org/show_bug.cgi?id=16167>
2008-10-06Loader: Unexport a handful of consumerless symbols from dixsym.Adam Jackson1-1/+1
2008-10-06xalloc+bzero -> xcallocAdam Jackson1-5/+2
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/+35
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-22/+41
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 Hutterer3-277/+69
This removes all the meta-information about device properties (pending, fromClient, range, valid_values, immutable).
2008-09-19Xi: don't include client-side headers.Peter Hutterer1-1/+0
Spotted by Mikhail Gusarov.
2008-09-18Xi: remove broken SDeviceEnterNotifyEvent, replace with ...Leave...Peter Hutterer1-11/+1
The event format is the same for both (bar the type), so one is enough.
2008-08-28Prepare for array-index based devPrivates.Tomas Carnecky1-1/+2
TODO: static indices can be made just an int; some indices can be combined.
2008-08-22Xi: don't include .c files.Peter Hutterer1-2/+1
2008-08-22Xi: swap devices property replies.Peter Hutterer3-0/+55
2008-08-15Backport device properties to XI 1.5 instead of XI 2.0Peter Hutterer3-59/+72
2008-08-14Xi: byte-swap device property requests.Peter Hutterer1-12/+32
2008-08-12Xi: return the state from the correct keyboard in QueryDevicePointer.Peter Hutterer1-2/+4
2008-07-29Xi: ChangeDeviceControl presence events should set the appropriate devchange.Peter Hutterer1-1/+1
Requires inputproto 1.4.4 or higher.
2008-07-24Shape extension is built-in and mandatory.Adam Jackson1-2/+0
2008-07-13Xi: expose Enable/DisableDevice through XI_PROP_ENABLED property.Peter Hutterer3-0/+50
2008-07-13Xi: protect against NULL handlers, don't try to dereference.Peter Hutterer1-2/+4
2008-07-13Xi: remove ChangeDeviceControl for CoreCtl.Peter Hutterer1-14/+3
If you want to set a device to core, attach it to a master device.
2008-07-13Xi: GetDeviceProperty reply includes deviceid.Peter Hutterer1-0/+1
2008-07-10Xi: pack the property stuff into a struct, make handlers a linked list.Peter Hutterer1-38/+116
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 Hutterer4-4/+817
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 Hutterer4-804/+4
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 Hutterer4-4/+804
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-10Xext: store the GenericMasks in the resource system.Peter Hutterer1-1/+1
This fixes a severe issue - when the client died the event mask didn't get unregistered and a future event would dereference dangling pointers. By storing the event masks in the resource system we can free them when the client dies.
2008-06-26input: for non-device events (e.g. DevicePresence) use MAX_DEVICES as id.Peter Hutterer1-2/+2
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-20/+21
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>