summaryrefslogtreecommitdiff
path: root/Xi
AgeCommit message (Collapse)AuthorFilesLines
2011-04-24Xi: remove duplicated includesNicolas Kaiser1-2/+0
Remove duplicated includes. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-04-18Xi: don't swap the status byte in the XIPassiveGrab repliesPeter Hutterer1-4/+7
Reported-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18Xi: exit with error value if CheckGrabValues failed.Peter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18Xi: fix reply swapping function check for XIPassiveGrabDevicePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18Xi: return the bad device ID if a passive grab fails with BadDevice.Peter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18Xi: silence valgrind warning. (#36120)Peter Hutterer1-0/+2
Conditional jump or move depends on uninitialised value(s) at 0x4357A1: GetEventMask (events.c:454) by 0x43B9E8: DeliverEventsToWindow (events.c:2029) by 0x4E0C59: SendEventToAllWindows (exevents.c:2125) by 0x4E8301: XISendDeviceHierarchyEvent (xichangehierarchy.c:118) by 0x426F99: DisableDevice (devices.c:507) by 0x46BF72: xf86Wakeup (xf86Events.c:457) by 0x432ABA: WakeupHandler (dixutils.c:419) by 0x45B708: WaitForSomething (WaitFor.c:235) by 0x42E8D9: Dispatch (dispatch.c:367) by 0x422DC9: main (main.c:287) Uninitialised value was created by a stack allocation at 0x4E8190: XISendDeviceHierarchyEvent (xichangehierarchy.c:61) Conditional jump or move depends on uninitialised value(s) at 0x43BB78: DeliverEventsToWindow (events.c:2010) by 0x4DDEEA: FindInterestedChildren (exevents.c:2103) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4E0C6F: SendEventToAllWindows (exevents.c:2127) by 0x4E8301: XISendDeviceHierarchyEvent (xichangehierarchy.c:118) by 0x426F99: DisableDevice (devices.c:507) by 0x46BF72: xf86Wakeup (xf86Events.c:457) by 0x432ABA: WakeupHandler (dixutils.c:419) by 0x45B708: WaitForSomething (WaitFor.c:235) Uninitialised value was created by a stack allocation at 0x4E8190: XISendDeviceHierarchyEvent (xichangehierarchy.c:61) Set the type of dummyDev to SLAVE. The jump listed above comes from a check to IsMaster() in GetEventMask() that would then set the XIAllMasterDevices mask. Hierarchy events can only be set for XIAllDevices so the above IsMaster() check had no effect and the device type doesn't really matter anyway beyond shuting up valgrind. Also initialize dummyDev to 0 to ease future debugging. X.Org Bug 36120 <http://bugs.freedesktop.org/show_bug.cgi?id=36120> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-18Xi: fix valuator alignment in DeepCopyDeviceClasses (#36119)Peter Hutterer1-7/+4
commit 678f5396c91b3d0c7572ed579b0a4fb62b2b4655 only fixed the initialization, not the copy. After a slave device change, the valuator were out of alignment again. X.Org Bug 36119 <http://bugs.freedesktop.org/show_bug.cgi?id=36119> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-04Merge remote-tracking branch 'vignatti/for-keith'Keith Packard4-7/+13
2011-04-04xi: fix memory leak in AddExtensionClientTiago Vignatti1-2/+6
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
2011-04-04Xi: fix memory leak in ProcXGetSelectedExtensionEventsTiago Vignatti1-1/+1
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-04xi: fix memory leak in ProcXIQueryDeviceTiago Vignatti1-1/+3
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-04xorg: remove unused pointer values all over the serverTiago Vignatti2-3/+3
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-02Xi: fix querydevice request swappingMatthieu Herrb1-1/+2
WriteReplyToClient() swaps rep.length, so it can't be used on return of WriteReplyToClient(). So save it's value for later use. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-04-02Xi: add XI_Focus{In,Out} to swapped events.Matthieu Herrb1-0/+2
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-04-02Xi: take XI2 requests into account also for the swapping case.Matthieu Herrb1-2/+3
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-03-24xserver: remove AbsoluteClassRec keeping the ABISimon Thum3-167/+4
This removes the struct, but keeps InitAbsoluteClassDeviceStruct as a no-op and preserves related struct layout. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-24simplify ChangeDeviceControl in stubsSimon Thum1-11/+1
Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-09Merge remote branch 'whot/for-keith'Keith Packard2-4/+4
2011-03-09Xi: fix XI2 passive grab reply length calculationPeter Hutterer1-2/+2
If modifiers failed, the reply length was 4 bytes too short. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-03-09Xi: fix length checks for swapped clientsJulien Cristau1-2/+2
ChangeDeviceProperty and XIChangeProperty are followed by some data, so use REQUEST_AT_LEAST_SIZE instead of REQUEST_SIZE_MATCH. X.Org bug#35082 <https://bugs.freedesktop.org/show_bug.cgi?id=35082> Reported-by: Markus Fleschutz <markus.fleschutz@x-software.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-08xi: Use RESTYPE consistentlyAdam Jackson2-2/+2
No functional change Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-02-23Merge branch 'mi-cleanup' into nextPeter Hutterer7-21/+18
2011-02-22input: Change a bunch of direct dev->u.master accesses to use GetMaster()Peter Hutterer3-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22Xi: replace a direct master access with GetMaster()Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22Switch to use IsFloating()Peter Hutterer5-14/+8
This is not a straightforward search/replacement due to a long-standing issue. dev->u.master is the same field as dev->u.lastSlave. Thus, if dev is a master device, a check for dev->u.master may give us false positives and false negatives. The switch to IsFloating() spells out these cases and modifies the conditions accordingly to cover both cases. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22Fix two incorrect checks for master devices.Peter Hutterer1-0/+3
These two were sideeffects of lastSlave being in the same field as the master. For devices generated by the master device directly, lastSlave was 0 and the device would (with the old checks) be interpreted as floating. Add the required checks to safeguard against master devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-17Check for OOM condition in XISendDeviceHierarchyEventBryce Harrington1-0/+2
When system is out of memory, calloc can fail returning a NULL pointer. Check for this before dereferencing it, and bail out if it fails. Ref.: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/720445 Signed-off-by: Bryce Harrington <bryce@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-17Input: Actually send Xi 1.x DeviceStateNotify eventsDaniel Stone1-1/+1
When a client has selected for Xi 1.x DeviceStateNotify events, they should receive them when a DeviceFocusIn event is generated. The code to do this was there, but an incorrect test meant they were never being sent. The "type" passed in is the XI2 type, the XI1 type is in event.type. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-17Input: Store passive-activating key in CheckDeviceGrabsDaniel Stone1-3/+1
CheckDeviceGrabs will activate a passive grab for KeyPress and ButtonPress events. GrabInfoRec::activatingKey contains the keycode which activated the passive grab, so we can deactivate it later in ProcessOtherEvents. Previously, CheckDeviceGrabs relied on its callers to set activatingKey, which not all callers were doing (I'm looking at you, ComputeFreezes). Just set it in CheckDeviceGrabs instead. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-14Xi: make XIQueryPointer return the current modifiers/group as documented.Carlos Garnacho1-1/+1
The previous XKB info was being returned instead of the current one, producing inconsistent results between the latest events and the modifiers/group returned by this call. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>` Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-14Xi: constify XIChangeDeviceProperty()Peter Hutterer1-1/+1
We don't modify "value", make it official. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
2011-01-20Xi: reset remainders when warping the device.Peter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-01-06Input: Pass sprite instead of device to FixUpEventFromWindowDaniel Stone1-1/+2
Since FixUpEventFromWindow only uses the sprite trace to determine the window stack, pass in a sprite instead of hardcoding the device sprite, so we can deliver to windows other than the one currently containing the sprite. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-06Input: Swap flags in DeviceEventsDaniel Stone1-0/+1
Swap flags for different-endian clients when delivering XI2 DeviceEvents. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-12-31Input: Set client error value for invalid mask bitsDaniel Stone3-4/+15
When we send BadValue back to the client for having invalid mask bits, at least tell them what the (first) invalid bit was. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-07Xi: Fix master button update when slave buttons are mapped. #24887Eoghan Sherry1-2/+4
It is currently assumed that an event button delieved to a master device corresponds to the slave button states. However, the event button is a logical (mapped) slave button and slave button states correspond to physical (unmapped) slave buttons. This leads to incorrect update of the master button state and incorrect events devlivered to clients. Fix the situation by taking the slave button map into account when querying a slave button state. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24887 Signed-off-by: Eoghan Sherry <ejsherry@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-12Xi: move property reset from extension shutdown to init.Peter Hutterer1-2/+2
If any part of the stack calls XIGetKnownProperty during device shutdown the property is re-initialized before the server generation resets, leaving the value invalid again. Move the reset to the extension init which happens before input devices are initialized before the first property is requested. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-11-11Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into ↵Peter Hutterer2-245/+281
input-api Conflicts: dix/getevents.c hw/xfree86/common/xf86Xinput.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-09Xi: if XTEST device creation fails, fail the master devices.Peter Hutterer1-0/+4
When getting close to the MAXDEVICES limit, the creation of XTEST devices may fail due to device id exhaustion. In that case, fail the creation of master devices too and return an error to the client. Theoretically, we could alloc the MDs without the XTEST devices but that will get interesting when a client starts sending XTEST events through those devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-11-09Xi: rename two variables from ptr to dev.Peter Hutterer1-14/+14
They were named ptr when everything was in one function to save one more variable. Now that the stuff is split out, "dev" makes more sense. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-11-09Xi: split hierarchy manipulation into static functions.Peter Hutterer1-243/+275
No functional changes, just code cleanup to improve readability. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-10-29Xi: reshuffle conditions for labeling a device as IsXExtensionKeyboard (#29046)Peter Hutterer1-2/+2
From the original bug reporter Ezra Reeves: "I did some more digging on this today, and I found that an HP branded wireless USB mouse has the same issue. With this mouse (as well as the logitech wireless mouse), the return from: xdev = XListInputDevices(GDK_WINDOW_XDISPLAY(rootwin), &ndevices_return); lists the USB device twice, but both have xdev[num].use == 3 (IsXExtensionKeyboard as defined in X11/XI.h). [...] Swapping the order of the test in Xi/listdev.c that determines whether a device is a pointer or a keyboard properly detects my devices (OEM USB wireless mouse/kb combo) -- one as a keyboard and one as a pointer." X.Org Bug 29046 <http://bugs.freedesktop.org/show_bug.cgi?id=29046> Reported-by: Erik Kilfoil <ekilfoil@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-25Convert some leftover axes->mode access to valuator_get_mode()Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22input: remove "mode" field from ValuatorClassRec.Peter Hutterer4-6/+7
We have per-axis mode now. For those bits that still need it (XI 1.x), assume that the first axis holds the device's mode. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22input: move proximity state into ProximityClassRec.Peter Hutterer2-3/+7
Previously the OutOfProximity bit in the valuator mode. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22Add support for per-axis valuator modes (Relative/Absolute)Chase Douglas2-2/+3
The XI2 protocol supports per-axis modes, but the server so far does not. This change adds support in the server. A complication is the fact that XI1 does not support per-axis modes. The solution provided here is to set a per-device mode that defines the mode of at least the first two valuators (X and Y). Note that initializing the first two axes to a different mode than the device mode will fail. For XI1 events, any axes following the first two that have the same mode will be sent to clients, up to the first axis that has a different mode. Thus, if a device has relative, then absolute, then relative mode axes, only the first block of relative axes will be sent over XI1. Since the XI2 protocol supports per-axis modes, all axes are sent to the client. Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-15Merge branch 'master' into input-apiPeter Hutterer1-2/+1
Conflicts: config/udev.c hw/xfree86/common/xf86Helper.c hw/xfree86/common/xf86Module.h hw/xfree86/common/xf86Xinput.h hw/xfree86/os-support/linux/lnx_init.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01input: Purge AddOtherInputDevices DDX hook.Peter Hutterer2-46/+0
This hook wasn't used by any DDX. Device addition and removal is handled by the config backend, so we don't need to do anything special that during the ListInputDevices request processing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01input: remove OpenInputDevice and CloseInputDevice DDX hooks.Peter Hutterer3-48/+0
In theory, these hooks were to be used for DDX-specific device enablement. None of the DDXs however did anything here. Now we call DEVICE_INIT on all devices when they are added, so the xfree86 DDX as the only one with real code didn't do anything here. kdrive checked for device validity but that's already handled in ProcXOpenDevice. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01input: Purge Register*Device() functions.Peter Hutterer2-8/+0
RegisterPointerDevice() and RegisterKeyboardDevice() were already mapped to RegisterOtherDevice() and obsolete. RegisterOtherDevice() was called for all devices and the two assignments can simply be moved into AddInputDevice(). Purge RegisterOtherDevice() and pretend it never happened. *lalalalala* Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>