summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2012-01-24Don't set X and Y valuators for indirect touch eventsChase Douglas1-1/+1
For expediency, it made sense to always have the X and Y axes set for direct touch device event propagation. The last X and Y values are stored internally. However, indirect device touch event propagation does not depend on the touch's X and Y values. Thus, we don't need to set the values for every indirect touch event. On top of this, the previous X and Y values aren't stored for indirect touches, so without this change the axes get erroneously set to 0. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-24UngrabAllDevices: Don't kill clients if not told toDaniel Stone1-1/+2
The kill_client argument to UngrabAllClients specifies if we want to kill the client holding the grab or just deactivate the grab. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reported-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-24Only update pointer motion data for pointer emulated touch eventsChase Douglas1-2/+6
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>
2012-01-24Only scale direct device touch coordinatesChase Douglas1-1/+6
Indirect touch devices provide valuator values in pure device coordinates. They also don't need to be fixed up for screen crossings. 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>
2012-01-13Use event time instead of CurrentTime for grab timesChase Douglas1-1/+2
When {XI,X,}AllowEvents is called, the timestamp is compared against the grab time to ensure that the request pertains to the current grab in the server. While many clients may use CurrentTime (client-side), the timestamp of the event causing the grab is also valid. This change ensures that the server's notion of the grab time is the time of the event that activated the grab rather than the time that the grab is actually activated. This bug was exposed through nested touch then pointer grabs. 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>
2012-01-13dix: Update pointer limits for floating devices too (#43635)Peter Hutterer1-1/+1
When the screen is restructured, the pointer limits need to be reset for floating slave devices as well, not just for master pointers. Only skip devices that don't have a cursor (attached slaves and keyboard) Bug reproducer: float an absolute slave device, rotate the screen - the device is now confined to a section of the screen only. X.Org Bug 43635 <http://bugs.freedesktop.org/show_bug.cgi?id=43635> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-01-12Revert "dix: Extend initial connection handshake for forwarding proxies"Keith Packard1-9/+3
This reverts commit 78fa121f4097d29458e5453c13473595df06e26e. ABI change pended for 1.13
2012-01-09Merge remote-tracking branch 'whot/multitouch'Keith Packard1-0/+4
2012-01-09Revert "dix: don't return BadMatch from GetProperty (#23562)"Chris Halse Rogers1-1/+1
This reverts commit f04fe06ae244b851b38be824b1a80f2f8a030591. dixLookupWindow no longer returns BadMatch. No other caller was checking for it, so this problem is now fixed in the utility function. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-01-09dix: Return BadWindow rather than BadMatch from dixLookupWindowChris Halse Rogers1-1/+9
dixLookupWindow uses dixLookupDrawable internally, which returns BadMatch when the XID matches a non-Window drawable. Users of dixLookupWindow don't care about this, just that it's not a valid Window. This is a generalised version of the fix for X.Org Bug 23562, where GetProperty was incorrectly returning BadMatch. Auditing other window requests, all that I checked would incorrectly return BadMatch in these circumstances. An incomplete list of calls that could incorrectly return BadMatch is: ListProperties, SetSelectionOwner, {Destroy,Map,Unmap}{,Sub}Window. None of the callers of dixLookupWindow, except for GetProperty, check for BadMatch Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-01-09Merge commit '777bf90abeac37087a3d0538b847742523d5acf2'Keith Packard2-12/+21
2012-01-06dix: Tune dixLookupDrawable for successAdam Jackson1-4/+3
The vast vast vast majority of resource lookups are successful. Move some work to the error paths so we don't punish success. Before: 40000000 trep @ 0.0009 msec (1109091.3/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square After: 40000000 trep @ 0.0009 msec (1148346.9/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2091666.1/sec): ShmPutImage 10x10 square Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06dix: Tune dtrace hooks around DispatchAdam Jackson1-5/+9
Don't call LookupMajorName if the hooks aren't active, it's quite expensive. Before: 40000000 trep @ 0.0009 msec (1087458.5/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square After: 40000000 trep @ 0.0009 msec (1109091.3/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06dix: Extend initial connection handshake for forwarding proxiesAdam Jackson1-3/+9
Forwarding proxies like sshd will appear to be local, even though they aren't really. This leads to weird behaviour for extensions that truly require running under the same OS services as the client, like MIT-SHM and DRI2. Add two new legal values for the initial connection's byteOrder field, 'r' and 'R'. These act like 'l' and 'B' respectively, but have the side effect of forcing the client to be treated as non-local. Forwarding proxies should attempt to munge the first packet of the connection accordingly; older servers will reject connections thusly munged, so the proxy should fall back to passthrough if the munged connection attempt fails. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06dix: Set XITouchEmulatingPointer on events from the touch sequence emulating ↵Carlos Garnacho1-0/+4
pointer events The internal flag is kept around, merely translated to XITouchEmulatingPointer when creating the XI2 events that will be delivered to the client. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-06dix: fix wrong condition checking for attached slave (#44003)Peter Hutterer1-1/+1
We need to update the master if the device is not a master _and_ it is not floating. X.Org Bug 44003 <http://bugs.freedesktop.org/show_bug.cgi?id=44003> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-01-06dix: on PointerRootWin send a FocusIn to the sprite window tooPeter Hutterer1-0/+3
XTS XSetDeviceFocus-7 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-01-06dix: send focus events to the immediate parent (#44079)Peter Hutterer1-3/+3
For a transition from windows A to B, A->parent did not receive an event. DeviceFocusOutEvents sends to windows ]from, to[, so start with the actual window, not it's parent. X.Org Bug 44079 <http://bugs.freedesktop.org/show_bug.cgi?id=44079> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2011-12-22Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into ↵Peter Hutterer5-8/+10
multitouch Conflicts: configure.ac dix/inpututils.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-21dix: fix xi2 mask/filter when delivering grabbed eventsCarlos Garnacho1-2/+2
Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-21dix: remove requirement for client_id be the first elementPeter Hutterer1-2/+5
Leftover code from an earlier version of GetTouchEvents. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: don't retrieve the syncEvents tail on an empty listPeter Hutterer1-2/+3
An empty list points to itself but syncEvents has the list head only and is of a different format than the elements. Thus, casting it to a QdEventPtr gives us garbage. Segfaults with XTS test case Xlib13/XGrabKeyboard Introduced in 7af23259d88f4c28ed21140f82cc03b3724c06bb. Reported-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: button state must show the logical buttons, not physical buttonsPeter Hutterer1-1/+1
If the device is mapped 3 2 1, a click on physical button 1 sends a button 3 press, but the state was set for button 1. Fix this, the state must be set for that button's logical mapping. https://bugzilla.gnome.org/show_bug.cgi?id=655928 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: Remove touch grabs if the grab disappearsDaniel Stone2-0/+47
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: hook up passive grabs and pointer emulated passive grabsPeter Hutterer2-4/+59
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: add touch to pointer event conversion helperPeter Hutterer1-0/+62
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: add real_event parameter to ActivatePassiveGrabPeter Hutterer1-3/+7
For touch events with pointer emulation, the event that triggers the grab (the pointer event) is not the same as the actual event (the touch event). For replaying, we need to store the real event then. No effective changes at this point, for the current caller event and real_event are identical. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21Process and deliver touch eventsPeter Hutterer1-2/+3
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-21dix: set core and button state based on the touch statePeter Hutterer1-0/+5
If a pointer-emulating touch caused a button to be logically down, set that state in the input events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: add TouchResourceIsOwner helper functionPeter Hutterer1-0/+10
The first listener in the sequence is the owner of the touch sequence. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: add helper functions for adding/removing touch listenersPeter Hutterer1-0/+223
The DIX will call TouchSetupListeners once for a new touch. After that the listener list remains static, with listeners only dropping out when they either reject the grab or disappear. Exception: if grabs activate they are prefixed to the listeners. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: add TouchGetPointerEventType helper functionChase Douglas1-0/+21
Returns the respective pointer event type for a given touch event type. 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-2/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: add helper functions to build up/verify the sprite traceDaniel Stone1-0/+87
Touch events' sprite trace stays the same for the duration of the touch sequence. 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-21dix: add touch event history helper functionsPeter Hutterer1-0/+109
If touch client has not registered for ownership events and a grab above that client is rejected, the client needs to receive the complete event history. The history currently doesn't really do fancy overflow handling. We assume that the first TOUCH_HISTORY_SIZE events are the important ones and anything after that is dropped. If that is a problem, fix the client that takes > 100 event to decide whether to accept or reject. Events marked with TOUCH_CLIENT_ID or TOUCH_REPLAYING must not be stored in the history, they are events created by the DIX to comply with the protocol. Any such event should already be in the history anyway. A fixme in this patch: we don't have a function to actually deliver the event yet. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: handle DIX-submitted touch eventsPeter Hutterer1-20/+57
The DIX needs to submit touch events for e.g. TouchEnd after an acceptance/rejection. These have the TOUCH_CLIENT_ID flag set. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: button state must show the logical buttons, not physical buttonsPeter Hutterer1-1/+1
If the device is mapped 3 2 1, a click on physical button 1 sends a button 3 press, but the state was set for button 1. Fix this, the state must be set for that button's logical mapping. https://bugzilla.gnome.org/show_bug.cgi?id=655928 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21dix: don't retrieve the syncEvents tail on an empty listPeter Hutterer1-2/+3
An empty list points to itself but syncEvents has the list head only and is of a different format than the elements. Thus, casting it to a QdEventPtr gives us garbage. Segfaults with XTS test case Xlib13/XGrabKeyboard Introduced in 7af23259d88f4c28ed21140f82cc03b3724c06bb. Reported-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-20dix: generate touchpoints from driver-submitted dataDaniel Stone1-2/+148
The touchpoints are generated, enqueued but not processed since we don't handle them in the event processing yet. 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-20dix: add GetTouchOwnership event APIDaniel Stone1-0/+35
No callers yet. This API is not to be used by drivers, it's an API for the DIX which will create ownership events mainly on touch acceptance/rejection. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-20dix: add DIX API to create touchpointsPeter Hutterer1-0/+123
The DIX touchpoints are the ones used for event processing. 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-20dix: if we run out of space for new touch events, resize the queuePeter Hutterer1-1/+67
The SIGIO handler forces us to drop the current touch and schedule the actual resize for later. Should not happen if the device sets up the TouchClassRec with the correct number of touchpoints. 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-19dix: add helper functions to create DDX touch recsPeter Hutterer1-0/+116
DDX touch points are the ones that keep records of the driver-submitted touchpoints. They're unaffected by the grab state and terminate on a TouchEnd submitted by the driver. The client ID assigned is server-global. Since drivers usually submit in the SIGIO handler, we cannot allocate in the these functions. 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-19input: add a TouchClassRec to the devicesDaniel Stone3-1/+181
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-19Add the touch input API stubsDaniel Stone1-0/+48
xf86PostTouchEvent is the driver API to submit touch events to the server. This API doesn't do anything yet though but now we can at least bump the API. For valuators, drivers should use the existing xf86InitValuatorAxisStruct function. 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 Hutterer2-0/+34
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/+25
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-2/+25
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-16dix: split positionSprite into scale_to_desktop and positionSpritePeter Hutterer1-20/+52
For future touch points, we need positionSprite to calculate the coordinates but we don't want to actually change the cursor position for non-emulating touches. No functional changes at this point. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-14Merge remote-tracking branch 'whot/for-keith'Keith Packard8-416/+598