summaryrefslogtreecommitdiff
path: root/mi/mipointer.c
AgeCommit message (Collapse)AuthorFilesLines
2012-03-27Introduce a consistent coding styleKeith Packard1-166/+153
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)
2011-10-13input: change pointer screen crossing behaviour for multiple ScreenRecsPeter Hutterer1-3/+15
miPointerSetPosition traditionally took coordinates on a per-screen basis, triggering a screen switch when these went out-of-bounds. For absolute devices, this prevented screen crossing in the negative x/y direction. This patch changes the event generation patch to handle screen coordinates in a desktop range (i.e. all screens together). Screen switches are triggered when these coordinates are not on the current screen. This unifies the pointer behaviour of single ScreenRec multihead and multiple ScreenRecs multihead in that the cursor by default moves about the whole screen rather than be confined to one single screen. The transformation matrix may then be used to actually confine the cursor to the screen again. Note: fill_pointer_events has to deal with several different coordinate systems. Make sure you read the comment before trying to understand the code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-11mi: switch miPointerSetPosition to take doublesPeter Hutterer1-18/+29
Don't switch between doubles and ints in the caller, instead take doubles in miPointerSetPosition and do the conversion there. For full feature we should change everything down from here for doubles too. Functional change: previously we'd restore the remainder regardless of screen switching/confinement (despite what the comment said). Now, screen changing or cursor constraints will cause the remainder be clipped off. This should happen for cursor constraints but arguably not for screen crossing. This also corrects a currently wrong comment about miPointerSetPosition's input coordinates. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-11mi: return the screen from miPointerSetPositionPeter Hutterer1-7/+7
miPointerSetPosition may switch screens. Always return the screen the sprite is on instead of relying on callers to call miPointerGetScreen(). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22mi: fix comment typo, whitespace in miPointerSetPositionPeter Hutterer1-5/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-01input: add POINTER_NORAW to avoid generation of raw events (#30068)Peter Hutterer1-1/+1
RawEvents are supposed to be events coming from the driver. When warping the pointer, this should not generate a raw event. X.Org Bug 30068 <http://bugs.freedesktop.org/show_bug.cgi?id=30068> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-11input: replace EventListPtr with InternalEvent arrayPeter Hutterer1-2/+3
EventListPtr is a relic from pre-1.6, when we had protocol events in the event queue and thus events of varying size. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-04xorg: remove unused pointer values all over the serverTiago Vignatti1-1/+0
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-03-14mi: Call pScreen->ConstrainCursorHarder from the position update pathAdam Jackson1-0/+6
v2: Cover more paths, spotted by Daniel Stone. v3: pass down the mode field for movement mode. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-14Add mode field to pointer movement hooks.Peter Hutterer1-1/+5
Preparation work for pointer barriers. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-22mi: check for MASTER_POINTER instead of manual checks.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 Hutterer1-2/+2
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-22mi: simplify a "check for keyboard" conditionPeter Hutterer1-2/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22mi: remove if 0 code.Peter Hutterer1-25/+0
Note sure why this is in if 0 but it's been that way since 2007. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22mi: Add a few comments explaining various cursor move functions.Peter Hutterer1-15/+138
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22mi: remove static GenerateEvent variable.Peter Hutterer1-4/+5
Push into the respective devices. This should have no functional changes since we never warp more than one device at a time. In the glorious future with true multithreading, still the better thing to do. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2010-10-22Abstract valuator masks through a set of APIs.Peter Hutterer1-1/+5
This commit introduces an abstraction API for handling masked valuators. The intent is that drivers just allocate a mask, set the data and pass the mask to the server. The actual storage type of the mask is hidden from the drivers. The new calls for drivers are: valuator_mask_new() /* to allocate a valuator mask */ valuator_mask_zero() /* to reset a mask to zero */ valuator_mask_set() /* to set a valuator value */ The new interface to the server is xf86PostMotionEventM() xf86PostButtonEventM() xf86PostKeyboardEventM() xf86PostProximityEventM() all taking a mask instead of the valuator array. The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to memory allocation restrictions in SIGIO handlers. For easier review, a lot of the code still uses separate valuator arrays. This will be fixed in a later patch. This patch was initially written by Chase Douglas. Signed-off-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>
2010-07-07mi: rename miPointerMoved to miPointerMoveNoEvent.Peter Hutterer1-5/+5
Having miPointerMove and miPointerMoved is confusing, especially since both do the same thing bar the event delivery. Also, miPointerMove calls miPointerMoved which indicates some confusion in the temporal alignment of cause and effect. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-07-07mi: De-duplicate some code in mipointer.cPeter Hutterer1-16/+2
miPointerMoved already has the same code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-07-02Add API to update setting of waitForUpdate screen private in miPointerAlan Coopersmith1-0/+16
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard1-4/+8
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-05-14mi: removed unused PointerNonInterestBox functions.Oliver McFadden1-12/+0
Please note this patch breaks the ABI. Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-5/+5
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-21mi: check for NULL pointer before dereferences it in miPointerSetPositionTiago Vignatti1-3/+3
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22mi: use GetMaster() from MIPOINTER and MISPRITE.Peter Hutterer1-2/+2
Both may in some cases be called for a SD attached to a master keyboard. In this case, we need to get the right master device (i.e. the pointer). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22Input: rename DeviceIntRec->isMaster to ->type.Peter Hutterer1-5/+5
isMaster is not enough as long as we differ between master pointers and keyboard. With flexible device classes, the usual checks for whether a master device is a pointer (currently check for ->button, ->valuators or ->key) do not work as an SD may post an event through a master and mess this check up. Example, a device with valuators but no buttons would remove the button class from the VCP and thus result in the IsPointerDevice(inputInfo.pointer) == FALSE. This will become worse in the future when new device classes are introduced that aren't provided in the current system (e.g. a switch class). This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an IsMaster(dev).
2009-05-01mi: don't crash if we're trying to update the pointer for a keyboard.Peter Hutterer1-0/+3
If a device doesn't have a pointer, just return. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19mi: fix compiler warning - explicitly typecast to InternalEvent.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20mi: remove deprecated miPointerAbsoluteCursorPeter Hutterer1-9/+0
Functions that don't specify the device are so last year.
2009-02-04mi: don't call UpdateSpriteForScreen if we have Xinerama enabled. #18668Peter Hutterer1-1/+8
In Xinerama all windows hang off the first root window. Crossing the screens must not reset the spriteTrace, otherwise picking fails and events are sent to the root window. X.Org Bug 18668 <http://bugs.freedesktop.org/show_bug.cgi?id=18668> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Remove a bunch of useless casts.Adam Jackson1-1/+1
We've had void * for twenty years now people let's try to act like we know how it works.
2009-01-13dix: fix WarpPointer calls for devices with custom valuator ranges (#19297)Peter Hutterer1-1/+1
If the MD's lastSlave was a devices with custom axes ranges, then a WarpPointer would position the cursor at the wrong location. A WarpPointer request provides screen coordinates and these coordinates were scaled to the device range before warping. This patch consists of two parts: 1) in the WarpPointer handling, get the lastSlave and post the event through this device. 2) assume that WarpPointer coordinates are always in screen coordinates and scale them to device coordinates in GPE before continuing. Note that this breaks device-coordinate based XWarpDevicePointer calls (for which the spec isn't nailed down yet anyway) until a better solution is found. X.Org Bug 19297 <http://bugs.freedesktop.org/show_bug.cgi?id=19297> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-11XQuartz: Add locking to make mieq thread safe on OSXJeremy Huddleston1-0/+12
(cherry picked from commit 7a8d2266861e74176b5310b83652a9c10a170494)
2009-01-11mi: don't mix declarations and codeJulien Cristau1-2/+3
2009-01-11mi: ANSI cleanupsJulien Cristau1-1/+1
2008-12-12Remove #define NEED_EVENTS and NEED_REPLIESPeter Hutterer1-1/+0
A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-10/+10
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
2008-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-2/+2
This is the biggest "visibility" patch. Instead of doing a "export" symbol on demand, export everything in the sdk, so that if some module fails due to an unresolved symbol, it is because it is using a symbol not in the sdk. Most exported symbols shouldn't really be made visible, neither advertised in the sdk, as they are only used by a single shared object. Symbols in the sdk (or referenced in sdk macros), but not defined anywhere include: XkbBuildCoreState() XkbInitialMap XkbXIUnsupported XkbCheckActionVMods() XkbSendCompatNotify() XkbDDXFakePointerButton() XkbDDXApplyConfig() _XkbStrCaseCmp() _XkbErrMessages[] _XkbErrCode _XkbErrLocation _XkbErrData XkbAccessXDetailText() XkbNKNDetailMaskText() XkbLookupGroupAndLevel() XkbInitAtoms() XkbGetOrderedDrawables() XkbFreeOrderedDrawables() XkbConvertXkbComponents() XkbWriteXKBSemantics() XkbWriteXKBLayout() XkbWriteXKBKeymap() XkbWriteXKBFile() XkbWriteCFile() XkbWriteXKMFile() XkbWriteToServer() XkbMergeFile() XkmFindTOCEntry() XkmReadFileSection() XkmReadFileSectionName() InitExtInput() xf86CheckButton() xf86SwitchCoreDevice() RamDacSetGamma() RamDacRestoreDACValues() xf86Bpp xf86ConfigPix24 xf86MouseCflags[] xf86SupportedMouseTypes[] xf86NumMouseTypes xf86ChangeBusIndex() xf86EntityEnter() xf86EntityLeave() xf86WrapperInit() xf86RingBell() xf86findOptionBoolean() xf86debugListOptions() LoadSubModuleLocal() LoaderSymbolLocal() getInt10Rec() xf86CurrentScreen xf86ReallocatePciResources() xf86NewSerialNumber() xf86RandRSetInitialMode() fbCompositeSolidMask_nx1xn fbCompositeSolidMask_nx8888x0565C fbCompositeSolidMask_nx8888x8888C fbCompositeSolidMask_nx8x0565 fbCompositeSolidMask_nx8x0888 fbCompositeSolidMask_nx8x8888 fbCompositeSrc_0565x0565 fbCompositeSrc_8888x0565 fbCompositeSrc_8888x0888 fbCompositeSrc_8888x8888 fbCompositeSrcAdd_1000x1000 fbCompositeSrcAdd_8000x8000 fbCompositeSrcAdd_8888x8888 fbGeneration fbIn fbOver fbOver24 fbOverlayGeneration fbRasterizeEdges fbRestoreAreas fbSaveAreas composeFunctions VBEBuildVbeModeList() VBECalcVbeModeIndex() TIramdac3030CalculateMNPForClock() shadowBufPtr shadowFindBuf() miRRGetScreenInfo() RRSetScreenConfig() RRModePruneUnused() PixmanImageFromPicture() extern int miPointerGetMotionEvents() miClipPicture() miRasterizeTriangle() fbPush1toN() fbInitializeBackingStore() ddxBeforeReset() SetupSprite() InitSprite() DGADeliverEvent() SPECIAL CASES o defined as _X_INTERNAL xf86NewInputDevice() o defined as static fbGCPrivateKey fbOverlayScreenPrivateKey fbScreenPrivateKey fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h GetGlyphs() QueryGlyphExtents() QueryTextExtents() ParseGlyphCachingMode() InitGlyphCaching() SetGlyphCachingMode()
2008-10-08mi: functions here are carrying 'time' without need.Tiago Vignatti1-9/+8
2008-10-08mi: remove deprecated and unused functions.Tiago Vignatti1-20/+0
miPointerDeltaCursor, miPointerGetMotionBufferSize and miPointerSetNewScreen.
2008-08-28Prepare for array-index based devPrivates.Tomas Carnecky1-2/+4
TODO: static indices can be made just an int; some indices can be combined.
2008-07-04Remove deprecated function miPointerPosition().Tiago Vignatti1-6/+0
2008-06-13Fix "warning: unused variable ‘pDev’, `pPointer'".Eamon Walsh1-0/+2
2008-05-28mi: ansify.Peter Hutterer1-55/+27
2008-05-22mi: handle sprite even for floating slave devices.Peter Hutterer1-37/+12
We still don't render it, but we accept all the other calls to update it's internal state.
2008-05-21Merge branch 'hwcursor' into mpxPeter Hutterer1-1/+5
2008-05-21mi: shut up compiler warning (return w/o a value)Peter Hutterer1-1/+1
2008-05-16mi: remove miPointerUpdate() -> replaced by miPointerUpdateSprite().Peter Hutterer1-7/+1
In the xnest and vfb DDX we don't need the call anyway, it's performed by mieqProcessInputEvent.
2008-05-16mi: don't call from miPointerMoved into the spriteFuncs for anything but VCP.Peter Hutterer1-1/+5
Calling ->MoveCursor for anything but the HW-rendered VCP causes the SW-rendered cursor routines to be started, including mallocs, etc. Since miPointerMoved is called during SIGIO, this is a bad idea.
2008-05-16mi: remove miPointerUpdate() -> replaced by miPointerUpdateSprite().Peter Hutterer1-7/+1
In the xnest and vfb DDX we don't need the call anyway, it's performed by mieqProcessInputEvent.