summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2012-04-26Rename TouchEnsureSprite to TouchBuildSprite and event type checksChase Douglas1-2/+2
The function will be used for building a sprite for pointer emulation after an explicit device grab. This commit refactors the code so that TouchBuildSprite will function with any event type and moves the checks to the caller. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 3d06bfe93d33cfe6150d8fb0058ee7bc8d80622b)
2012-04-26Split out helper function TouchListenerAcceptReject()Chase Douglas1-0/+2
This will be used for accepting and rejecting touches in the future. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 447fe7a1a72513aa68145962c47894242c589cc9)
2012-03-30Xi: Fix TouchEnd to TouchUpdate change for one accepted grabChase Douglas1-1/+2
If there is only one listener of a touch, the listener is a grab, and is accepted before the touch has ended, the current code will not end the touch record when the touch does end. This change adds a listener state for when a touch is accepted but has not yet ended. We now keep the touch record alive in this state, but end it when the touch ends. 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> (cherry picked from commit 58427e08a4a36ce9e213e4b4fe5249d5db2c764d)
2012-03-27Introduce a consistent coding styleKeith Packard63-5376/+4934
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21)
2012-02-11Merge remote-tracking branch 'alanc/master'Keith Packard2-59/+59
2012-02-08Implement touch early acceptChase Douglas1-0/+2
This doesn't really implement early accept as it should. Ideally, the server should send end events to all subsequent touch clients as soon as an early accept comes in. However, this implementation is still protocol compliant. We can always improve it later. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08Check for proper window ID when processing touch allow requestsChase Douglas1-1/+1
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08Move AllowTouch to dix/touch.c, and rename to TouchAcceptRejectChase Douglas1-0/+2
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08Export TouchEventRejected as TouchRejectedChase Douglas1-0/+7
This function is mostly correct for early reject usage. With a small change to pass the client resource explicitly and making the TouchOwnership event optional, it is usable for all rejection scenarios. This change exports it for use outside Xi/exevents.c and modifies the name accordingly. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08Store window pointer in touch listener recordChase Douglas2-1/+3
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-03Namespace list api to reduce conflicts with similar system headersAlan Coopersmith2-59/+59
Rename functions/macros from list_* to xorg_list_* Rename struct from struct list to struct xorg_list. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> In-sed-I-trust: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-24include: Fix comment typoPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-13include: prettify BUG_WARN outputPeter Hutterer1-1/+2
ErrorF output is prefixed with a timestamp, so the previous output would look like this: [ 50.423] BUG: triggered 'if (dev->valuator->numAxes < 2)' BUG: getevents.c:842 in scale_to_desktop() Change this to have the prefix on both lines: [ 50.423] BUG: triggered 'if (dev->valuator->numAxes < 2)' [ 50.423] BUG: getevents.c:842 in scale_to_desktop() Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2012-01-12Revert "dix: Repack ClientRec"Keith Packard1-14/+15
This reverts commit f702372822dadb1fef92cfc25086481f640147b3. ABI change pended for 1.13
2012-01-12Revert "dix: Pull client-is-local flag up to the ClientRec"Keith Packard2-1/+2
This reverts commit 49d38b75c8f3276cfce33ffe6b8c4fbeb1081b96. ABI change pended for 1.13
2012-01-12Revert "dix: Fix types in WindowOptRec"Keith Packard1-2/+2
This reverts commit a4553019a10b4e01cc06f3081db71a83338697b4. ABI change pended for 1.13
2012-01-09Merge commit '777bf90abeac37087a3d0538b847742523d5acf2'Keith Packard3-19/+17
2012-01-06dix: Fix types in WindowOptRecAdam Jackson1-2/+2
No reason for these to be 64 bits on LP64. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06dix: Pull client-is-local flag up to the ClientRecAdam Jackson2-2/+1
Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06dix: Repack ClientRecAdam Jackson1-15/+14
sizeof(ClientRec) ILP32 LP64 before 120 184 after 104 136 Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
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>
2011-12-22Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into ↵Peter Hutterer5-7/+13
multitouch Conflicts: configure.ac dix/inpututils.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-21dix: remove requirement for client_id be the first elementPeter Hutterer1-2/+0
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: Remove touch grabs if the grab disappearsDaniel Stone1-0/+1
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 Hutterer1-0/+1
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 Hutterer1-0/+8
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-21dix: add touch to pointer event conversion helperPeter Hutterer1-0/+2
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-1/+1
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-0/+6
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: add TouchResourceIsOwner helper functionPeter Hutterer1-0/+1
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-1/+4
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/+1
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-0/+4
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/+4
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/+4
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-21Support XI 2.2 officiallyPeter Hutterer1-1/+1
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/+8
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/+5
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-19dix: add helper functions to create DDX touch recsPeter Hutterer1-0/+5
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 Stone2-0/+80
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/+14
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/+21
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-16xserver: check for elevated privileges not uid=0Antoine Martin1-0/+6
This allows us to run the server as a normal user whilst still being able to use the -modulepath, -logfile and -config switches We define a xf86PrivsElevated which will do the checks and cache the result in case it is called more than once. Also renamed the paths #defines to match their new meaning. Original discussion which led to this patch can be found here: http://lists.freedesktop.org/archives/xorg-devel/2011-September/025853.html Signed-off-by: Antoine Martin <antoine@nagafix.co.uk> Tested-by: Michal Suchanek <hramrach at centrum.cz> Reviewed-by: Jamey Sharp <jamey at minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-16Xi: process raw touch eventsPeter Hutterer1-0/+3
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-1/+7
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-16include: add a bunch of flags for GetTouchEvent processingPeter Hutterer1-0/+9
TOUCH_CLIENT_ID is set if the touch was generated from a client ID instead of a DDX/driver touch ID. i.e. submitted by the dix. TOUCH_END is a special flag that's required to force the touch to end. Since the protocol with grab replaying and pointer emulation is rather complex, it's quite hard to know otherwise when a touch sequence should really die. The others do what it says on the imaginary box. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-16include: RawTouchEnd is the last event nowPeter Hutterer1-1/+3
Plus, use the actual definition from the protocol instead of the numeric values. Turns out not everyone knows the protocol event IDs by heart. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-15include: fix BUG_WARN_MSG for constant messages onlyPeter Hutterer1-2/+2
Previous declaration required the use of a message + printf varargs. We obviously want to allow the use of just a message. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-14Merge remote-tracking branch 'whot/for-keith'Keith Packard8-17/+43
2011-12-13Merge branch 'for-whot' of git://people.freedesktop.org/~alanc/xserver into ↵Peter Hutterer1-1/+1
for-keith