summaryrefslogtreecommitdiff
path: root/mi/mipointer.c
AgeCommit message (Collapse)AuthorFilesLines
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.
2008-05-14mi: protect against NULL-pointer dereference.Peter Hutterer1-2/+2
Required by the recent patch to use a NullCursor instead of UndisplayCursor().
2008-05-13Remove UndisplayCursor API.Peter Hutterer1-13/+0
We can achieve the same thing by simply displaying a NullCursor, there's no need for a separate API.
2008-05-13mi: don't try to display a cursor for devices w/o cursors.Peter Hutterer1-2/+7
2008-04-25Standardise copyright headers for all new files created as part of MPX.Peter Hutterer1-7/+0
2008-03-04Merge branch 'master' into mpxPeter Hutterer1-1/+2
This merge reverts Magnus' device coorindate scaling changes. MPX core event generation is very different, so we can't scale in GetPointerEvents. Conflicts: Xi/opendev.c dix/devices.c dix/dixfonts.c dix/getevents.c dix/resource.c dix/window.c hw/xfree86/common/xf86Xinput.c mi/mipointer.c xkb/ddxBeep.c xkb/ddxCtrls.c xkb/ddxKeyClick.c xkb/ddxList.c xkb/ddxLoad.c xkb/xkb.c xkb/xkbAccessX.c xkb/xkbEvents.c xkb/xkbInit.c xkb/xkbPrKeyEv.c xkb/xkbUtils.c
2008-02-05mi: Only UpdateSpriteForScreen if we actually changed the screen. (Bug #12650)Peter Hutterer1-1/+7
X.Org Bug 12650 <http://bugs.freedesktop.org/show_bug.cgi?id=12650>
2008-01-03Merge branch 'master' into mpxPeter Hutterer1-22/+10
Conflicts: XTrap/xtrapddmi.c Xext/security.c Xext/xprint.c Xext/xtest.c Xext/xvdisp.c Xi/exevents.c Xi/grabdevb.c Xi/grabdevk.c Xi/opendev.c Xi/ungrdev.c Xi/ungrdevb.c Xi/ungrdevk.c dix/cursor.c dix/devices.c dix/dixutils.c dix/events.c dix/getevents.c dix/main.c dix/window.c hw/xfree86/ramdac/xf86Cursor.c include/dix.h include/input.h include/inputstr.h mi/midispcur.c mi/miinitext.c mi/misprite.c render/animcur.c xfixes/cursor.c xkb/xkbAccessX.c
2007-11-24mi: only call UpdateSpriteForScreen if the screen actually changed.Peter Hutterer1-1/+6
If we call it unconditionally, we flip the dev->spriteInfo->sprite permanently when using XTestFakeInput (once in CheckMotion as called from the processInputProc, another time in UpdateSpriteForScreen when we actually warp the cursor). USFS also updates to the screen's root window unconditionally, which is not really what we want if we haven't changed screen at all.
2007-11-08dix, mi: stop segfaults when a floating device emits events.Peter Hutterer1-1/+1
For pointers: don't try to set master->valuator fields if there is no master. For keyboards: check if device is valid before trying to access the fields in miPointerGetScreen (btw. this disables DGA events for floating keyboards). Also stop the hideous number of ErrorFs if we request the paired device for a floating dev.
2007-11-08Merge branch 'mpx' into mdsdPeter Hutterer1-0/+1
Conflicts: Xi/opendev.c
2007-11-07Merge branch 'master' into mpxPeter Hutterer1-0/+1
Conflicts: Xi/extinit.c Xi/grabdev.c Xi/setmode.c Xi/ungrdev.c dix/devices.c dix/events.c dix/getevents.c include/dix.h mi/midispcur.c mi/misprite.c xkb/xkbActions.c xkb/xkbEvents.c xkb/xkbPrKeyEv.c
2007-10-17Merge branch 'master' into XACE-SELINUXEamon Walsh1-0/+1
Conflicts: os/access.c
2007-10-17mi: don't call UndisplayCursor for non-sprite-owners.Peter Hutterer1-1/+2
Segfaults are bad.
2007-10-17mi: fix some macros to allow multiple cursors for master devices.Peter Hutterer1-13/+47
Macros defaulted to inputInfo.pointe rfor devices that weren't spriteOwners. Changed to take the device's master device now. This includes sticking in a number of checks and warnings that cursor rendering won't be called for floating devices.
2007-10-16mi: don't exclude inputInfo.pointer from rendering.Peter Hutterer1-3/+3
2007-10-02Fix #12650: "windows not receiving mouse events in multiple screens context"Dodji Seketeli1-0/+1
* dix/events.c, include/dix.h: (UpdateSpriteForScreen): added this to update the mouse sprite context when we switch from a pScreen to another. * mi/mipointer.c: (miPointerWarpCursor): as we are switching to a new pScreen, don't forget to update the mouse sprite context.