summaryrefslogtreecommitdiff
path: root/Xi
AgeCommit message (Collapse)AuthorFilesLines
2012-01-09Merge remote-tracking branch 'whot/multitouch'Keith Packard1-10/+10
2012-01-06Xi: change XIChangeDeviceProperty from const pointer to const void *Peter Hutterer1-1/+1
According to Daniel Kurtz, a typedef void *pointer is a atomic type. So a 'const pointer' is equivalent to 'void* const' instead of the intended 'const void*'. This technically changes the ABI, but we don't bump it for this. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-01-06Remove last listener on touch rejectChase Douglas1-8/+6
The current code short-circuits around the block that removes the rejecting listener if it is the only listener left. It also does not delete the touchpoint record if the touch has not physically ended. This change ensures the listener is removed under these circumstances. Signed-off-by: Chase Douglas <chase.douglas@ubuntu.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-06Don't end touchpoint if owning client hasn't accepted/rejectedChase Douglas1-2/+4
A touchpoint is ended when no further processing will take place for it. This includes the situation where there is only one grabbing client, and the client receives a touch end before it has accepted/rejected the touchpoint. This change ensures that a delivered touch end event is converted into a touch update event under the above scenario. If the event is left as a touch end event, the touchpoint will be ended in ProcessTouchEvent(). Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-21Xi: only activate the device grab if we don't already have onePeter Hutterer1-2/+2
If the device is already grabbed, don't activate the passive grab, it screws with our event masks. Just deliver to the grabbing client instead. Reported-by: Carlos Garnacho <carlosg@gnome.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Xi: assign correct grab_mode/other_device_mode in XI2 passive grabsCarlos Garnacho1-2/+8
CreateGrab() expects the keyboard mode to be stored in grab_mode, and the pointer mode in other_device_mode, so respect this in passive XI2 grabs, and switch modes if needed. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Xi: add the hooks for passive touch grabsPeter Hutterer2-4/+47
Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Xi: handle grab accept/reject requestsPeter Hutterer1-1/+52
Consists mostly of generating an ownership event and processing it. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Xi: hook up touch ownership handlingPeter Hutterer1-1/+154
Ownership changes don't get processed directly when they happen, instead the DIX submits an ownership event which goes through ProcessTouchEvents and ProcessTouchOwnershipEvents. Then on the required events are generated and sent to clients. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Xi: hook up pointer emulation for emulating touchesPeter Hutterer1-1/+176
Includes a hack for implicit grab activation, because integrating this requires a larger rewrite and I'm not sleeping enough as it is. Right now, we deliver the event and check before/after if there is an implicit grab on. If one activated, then store the event in the grab and switch the listener type to a grab listener. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Process and deliver touch eventsPeter Hutterer1-0/+401
Does not include pointer emulation handling. Does include partial ownership handling but not the actual processing of ownership events. Note: this commit is a retroactive commit extracted from a series of ~50 commits and may thus appear a bit more complicated than what you'd write out from scratch. Pointer processing tree is roughly: - ProcessOtherEvents - ProcessTouchEvents - DeliverTouchEvents - DeliverTouchBeginEvent|DeliverTouchEndEvent|... - DeliverOneTouchEvent Also hooks up the event history playing to the right function now. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Co-authored-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Xi: make UpdateDeviceState aware of touch eventsPeter Hutterer1-0/+33
Update the logical button state for pointer-emulating events. Button state must be kept separate from the ButtonClassRec to avoid clearing the button state on a touch end if there is a physical button still down. And obviously don't change the button state if we're currently replaying the event history for some client. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: when a window disappears, remove it from the touch sprite traceDaniel Stone1-0/+30
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Xi: allow selecting for touch eventsDaniel Stone1-0/+43
Selecting for any of XI_TouchBegin/Update/End/Ownership requires the three bits for begin/update/end to be set. Only one client at a time may select for XI_TouchBegin event Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-19input: add a TouchClassRec to the devicesDaniel Stone3-0/+101
These structs will be used to store touch-related data, events and information. Drivers must call InitTouchClassDeviceStruct to set up a multi-touch capable device. Touchpoints for the DDX and the DIX are handled separately - touchpoints submitted by the driver/DDX will be stored in the DDXTouchPointInfoRec. Once the touchpoints are processed by the DIX, new TouchPointInfoRecs are created and stored. This process is already used for pointer events with the last.valuators field. Note that this patch does not actually add the generation of touch events, only the required structs. TouchListeners are (future) recipients of touch or emulated pointer events. Each listener is in a state, depending which event they have already received. The type of listener defines how the listener got to be one. Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-19Hook up the ownership eventsPeter Hutterer1-0/+20
This patch applies most of the protocol conversions and the internal event type for ownership events. Note that ownership events are generated by the DIX only, they do not pass through the event queue. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-16Xi: process raw touch eventsPeter Hutterer3-1/+10
No-one can generated them yet, but if they could, we'd be processing them like there was no tomorrow. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-16Hook up TouchBegin/Update/End eventsPeter Hutterer2-0/+18
The are the same as device events internally but require the touch ID separately from the detail.button field (the protocol uses the detail field for the touch id). For simpler integration of pointer emulation we need to set the detail.button field while keeping the touchid around. Add the three new touch event types to the various places in the server where they need to be handled. The actual handling of the events is somewhat more complicated in most places. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-16Xi: add a FIXMEPeter Hutterer1-0/+2
All the DeepCopy stuff really needs to be shared between the init calls the drivers use and this code here. Too many bugs by not keeping the two in sync. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-16Xi: split ProcessOtherEvent into ProcessDeviceEventPeter Hutterer1-17/+29
No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13input: replace GRABTYPE_* with the InputLevel enumsPeter Hutterer9-27/+27
They achieve the same thing, re-use the more generic InputLevel so we can convert to/fro easier. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13Add GrabIsPointerGrab and GrabIsKeyboardGrab helpersPeter Hutterer1-6/+2
No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: split out core state and event state setting into helper functionsPeter Hutterer1-28/+3
no functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13Xi: split updating button count and state into helper functionsPeter Hutterer1-12/+29
Functional change: for a button mapped to 0, the motionHintWindow is not updated to the NullWindow anymore. Before it got updated unconditionally to the button mapping. I have no idea what the practical effect of this is, but I guess it's closer to the correct behaviour: pressing a button that's logically disabled now does not disrupt the motion hint delivery. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13Xi: deduplicate button motion mask settingPeter Hutterer1-12/+25
No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09Change disable_clientpointer return type to voidAlan Coopersmith1-1/+1
It doesn't return anything, nor does it's caller expect it to. Fixes Solaris Studio compiler error: "xichangehierarchy.c", line 214: Function has no return statement : disable_clientpointer Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-08Merge remote-tracking branch 'whot/for-keith'Keith Packard7-90/+146
2011-12-09Xi: rename "state" to "corestate" in ProcessDeviceEventsPeter Hutterer1-5/+5
'state' is shadowed by the XKB 'state' as well (which feeds into the event too), so rename this one to clarify that this is the core event state only. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09Xi: check button mapping value _before_ assigning itPeter Hutterer1-8/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09Xi: skip superfluous castPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09Xi: when removing a device, reset ClientPointers where neededPeter Hutterer1-0/+15
if a client had the to-be-removed device as ClientPointer, reset to NULL. Fixes #43165 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-09input: swap the server over to use the XI2mask structPeter Hutterer4-23/+45
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09dix: allocate temporary grabs on the heapPeter Hutterer4-53/+76
Once grabs start having nested memory locations, we can't just use the GrabRec on the stack anymore, we need to alloc/copy/free the grabs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-06Xi: avoid overrun of callback array.Dave Airlie1-2/+2
This code had an off-by-one and would allow writing one past the end of the callbacks array. Pointed out by coverity. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-29Xi: add FreeInputMask functionPeter Hutterer1-2/+10
Does what it says on the box, complements MakeInputMask. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-29Xi: add helper functions to alloc/free InputClientPtrsPeter Hutterer1-5/+18
Currently not needed since the InputClientRec is a self-contained struct. As part of the touch rework that won't be the case in the future and a function to allocate/free memory appropriately is required. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-29Xi: use single return code from XIPassiveGrabDevicePeter Hutterer1-16/+20
Some failures returned status but the actual return code was "ret". Use "ret" consistently and move status to the local block is used in. [the goto isn't necessary yet, but for a future patch] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-23Fix gcc -Wwrite-strings warnings in various extensionsAlan Coopersmith2-3/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Make XIGetKnownProperty take a const char * argumentAlan Coopersmith1-1/+1
Now that MakeAtom takes const char *, so can XIGetKnownProperty. Clears 71 warnings from gcc -Wwrite-strings of the form: devices.c:145:5: warning: passing argument 1 of 'XIGetKnownProperty' discards qualifiers from pointer target type ../include/exevents.h:128:23: note: expected 'char *' but argument is of type 'const char *' Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-09input: replace remaining GetPairedDevice() with GetMaster()Peter Hutterer2-4/+4
Wherever it's obvious which device we need (keyboard or pointer), use GetMaster() instead of GetPairedDevice(). It is more reliable in actually getting the device type we want. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-09Xi: allow passive keygrabs on the XIAll(Master)Devices fake devicesPeter Hutterer1-1/+1
They don't have a KeyClassRec, but we must still allow passive grabs on them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Bastien Nocera <hadess@hadess.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25Use new FP1616/FP3232 conversion functionsPeter Hutterer1-4/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-25Xi: send DeviceChangedEvents when the scroll valuators change valuePeter Hutterer1-1/+12
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25Xi: ensure the deviceid for DeviceChangedEvents is always the right onePeter Hutterer1-0/+1
If we're sending the event for a given device, make sure the deviceid is that of the device. This allows callers to use the same DCE for slave and master without having to fiddle the DCE's internal fields. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25dix: drop unused argument from XISendDeviceChangedEventPeter Hutterer1-3/+3
Instead of device and master (and just using master), drop the master argument and let the callers pass in the device the event is to be sent for. No effective functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-30Input: Add smooth-scrolling support to GetPointerEventsPeter Hutterer3-1/+122
For scroll wheel support, we used to send buttons 4/5 and 6/7 for horizontal/vertical positive/negative scroll events. For touchpads, we really want more fine-grained scroll values. GetPointerEvents now accepts both old-school scroll button presses, and new-style scroll axis events, while emitting both types of events to support both old and new clients. This works with the new XIScrollClass to mark axes as scrolling axes. Drivers mark any valuators that send scroll events with SetScrollValuator. (Currently missing: the XIDeviceChangeEvent being sent when a driver changes a scroll axis at run-time. This can be added later.) Note: the SCROLL_TYPE enums are intentionally different values to the XI2 proto values to avoid copy/overlapping range bugs. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29input: allow for max < min for relative axes on InitValuatorAxisStructPeter Hutterer1-1/+1
Relative axes are initialized with 0, -1 but so far this never had any effect as all users of this function (for relative axes) just set it to the defaults anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29input: switch InitValuatorAxisStruct to return BoolPeter Hutterer1-3/+5
Return errors instead of silently ignoring them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29Input: Add vertical and horizontal scroll axesDaniel Stone1-0/+5
To be used for smooth scrolling with future driver APIs, replacing Rel Vert Wheel and Rel Horiz Wheel axes, which have not been used in any open driver to date. Combined with double-granularity ValuatorMasks, these axes allow for fine-grained scroll data to be sent to clients. Future commits allow drivers to post these scroll axes to QueuePointerEvents/GetPointerEvents, which take care of emulating legacy scroll button events. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29Input: Convert DeviceIntRec::last to use doublesDaniel Stone1-2/+0
Change the last real user of a split integer/fractional co-ordinate system, DeviceIntRec's last->{valuators,remainder} to just have one set of doubles. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>