diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2006-11-23 17:15:14 +1030 |
---|---|---|
committer | Peter Hutterer <whot@hyena.localdomain> | 2006-11-23 17:15:14 +1030 |
commit | 1c7568b8a1417257fa67c7fca69aa253099b9461 (patch) | |
tree | 9e2079d6e643d1b332e62f5806cdc5f5e2030fb9 /hw | |
parent | f52d53e060d0468b658a565688d1f92c156405c7 (diff) |
mi: closing memory leak, miPointer is freed in miPointerCloseScreen
bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX
adding DeviceIntPtr parameter to ScreenRec's cursor functions.
cleanup of miPointer code to use same scheme in each function
dix: MPHasCursor() function determines checking whether to invoke
cursor rendering.
animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies
on the core pointer right now.
xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on
the core pointer right now.
rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on
the core pointer right now.
ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on
the core pointer right now.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/xf86Cursor.c | 8 | ||||
-rw-r--r-- | hw/xfree86/common/xf86RandR.c | 3 | ||||
-rw-r--r-- | hw/xfree86/dri/dri.c | 3 | ||||
-rw-r--r-- | hw/xfree86/rac/xf86RAC.c | 44 | ||||
-rw-r--r-- | hw/xfree86/ramdac/xf86Cursor.c | 5 |
5 files changed, 37 insertions, 26 deletions
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 46d812804..27264a252 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -69,7 +69,7 @@ typedef struct { static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y); static void xf86CrossScreen(ScreenPtr pScreen, Bool entering); -static void xf86WarpCursor(ScreenPtr pScreen, int x, int y); +static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); static void xf86PointerMoved(int scrnIndex, int x, int y); @@ -269,7 +269,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) (*pScr->AdjustFrame)(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0); if (pScreen == pCursorScreen) - xf86WarpCursor(pScreen, px, py); + xf86WarpCursor(inputInfo.pointer, pScreen, px, py); return Switched; } @@ -430,11 +430,11 @@ xf86CrossScreen (ScreenPtr pScreen, Bool entering) /* ARGSUSED */ static void -xf86WarpCursor (ScreenPtr pScreen, int x, int y) +xf86WarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { int sigstate; sigstate = xf86BlockSIGIO (); - miPointerWarpCursor(pScreen,x,y); + miPointerWarpCursor(pDev, pScreen,x,y); xf86Info.currentScreen = pScreen; xf86UnblockSIGIO (sigstate); diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index 288d72193..87d5a364b 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -34,6 +34,7 @@ #include "xf86DDC.h" #include "mipointer.h" #include <randrstr.h> +#include "inputstr.h" typedef struct _xf86RandRInfo { CreateScreenResourcesProcPtr CreateScreenResources; @@ -291,7 +292,7 @@ xf86RandRSetConfig (ScreenPtr pScreen, xf86SetViewport(pScreen, px, py); - (*pScreen->SetCursorPosition) (pScreen, px, py, FALSE); + (*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE); } return TRUE; diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index a49c63212..76f0b702a 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -70,6 +70,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mi.h" #include "mipointer.h" #include "xf86_OSproc.h" +#include "inputstr.h" #if !defined(PANORAMIX) extern Bool noPanoramiXExtension; @@ -2013,7 +2014,7 @@ DRIAdjustFrame(int scrnIndex, int x, int y, int flags) if (px > pScrn->frameX1) px = pScrn->frameX1; if (py < pScrn->frameY0) py = pScrn->frameY0; if (py > pScrn->frameY1) py = pScrn->frameY1; - pScreen->SetCursorPosition(pScreen, px, py, TRUE); + pScreen->SetCursorPosition(inputInfo.pointer, pScreen, px, py, TRUE); return; } diff --git a/hw/xfree86/rac/xf86RAC.c b/hw/xfree86/rac/xf86RAC.c index 23dab862f..022f4748e 100644 --- a/hw/xfree86/rac/xf86RAC.c +++ b/hw/xfree86/rac/xf86RAC.c @@ -154,13 +154,16 @@ static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth); static Bool RACCreateGC(GCPtr pGC); static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank); static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs); -static void RACRecolorCursor (ScreenPtr pScreen, CursorPtr pCurs, - Bool displayed); -static Bool RACRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor); -static Bool RACUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor); -static Bool RACDisplayCursor (ScreenPtr pScreen, CursorPtr pCursor); -static Bool RACSetCursorPosition (ScreenPtr pScreen, int x, int y, - Bool generateEvent); +static void RACRecolorCursor (DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCurs, Bool displayed); +static Bool RACRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCursor); +static Bool RACUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCursor); +static Bool RACDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCursor); +static Bool RACSetCursorPosition (DeviceIntPtr pDev, ScreenPtr pScreen, + int x, int y, Bool generateEvent); static void RACAdjustFrame(int index, int x, int y, int flags); static Bool RACSwitchMode(int index, DisplayModePtr mode, int flags); static Bool RACEnterVT(int index, int flags); @@ -586,6 +589,7 @@ RACStoreColors ( static void RACRecolorCursor ( + DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, Bool displayed @@ -594,15 +598,16 @@ RACRecolorCursor ( DPRINT_S("RACRecolorCursor",pScreen->myNum); SCREEN_PROLOG (RecolorCursor); ENABLE; - (*pScreen->RecolorCursor) (pScreen,pCurs,displayed); + (*pScreen->RecolorCursor) (pDev, pScreen,pCurs,displayed); SCREEN_EPILOG ( RecolorCursor, RACRecolorCursor); } static Bool RACRealizeCursor ( - ScreenPtr pScreen, - CursorPtr pCursor + DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCursor ) { Bool val; @@ -610,7 +615,7 @@ RACRealizeCursor ( DPRINT_S("RACRealizeCursor",pScreen->myNum); SCREEN_PROLOG (RealizeCursor); ENABLE; - val = (*pScreen->RealizeCursor) (pScreen,pCursor); + val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor); SCREEN_EPILOG ( RealizeCursor, RACRealizeCursor); return val; @@ -618,8 +623,9 @@ RACRealizeCursor ( static Bool RACUnrealizeCursor ( - ScreenPtr pScreen, - CursorPtr pCursor + DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCursor ) { Bool val; @@ -627,7 +633,7 @@ RACUnrealizeCursor ( DPRINT_S("RACUnrealizeCursor",pScreen->myNum); SCREEN_PROLOG (UnrealizeCursor); ENABLE; - val = (*pScreen->UnrealizeCursor) (pScreen,pCursor); + val = (*pScreen->UnrealizeCursor) (pDev, pScreen,pCursor); SCREEN_EPILOG ( UnrealizeCursor, RACUnrealizeCursor); return val; @@ -635,8 +641,9 @@ RACUnrealizeCursor ( static Bool RACDisplayCursor ( - ScreenPtr pScreen, - CursorPtr pCursor + DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCursor ) { Bool val; @@ -644,7 +651,7 @@ RACDisplayCursor ( DPRINT_S("RACDisplayCursor",pScreen->myNum); SCREEN_PROLOG (DisplayCursor); ENABLE; - val = (*pScreen->DisplayCursor) (pScreen,pCursor); + val = (*pScreen->DisplayCursor) (pDev, pScreen,pCursor); SCREEN_EPILOG ( DisplayCursor, RACDisplayCursor); return val; @@ -652,6 +659,7 @@ RACDisplayCursor ( static Bool RACSetCursorPosition ( + DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent) @@ -661,7 +669,7 @@ RACSetCursorPosition ( DPRINT_S("RACSetCursorPosition",pScreen->myNum); SCREEN_PROLOG (SetCursorPosition); ENABLE; - val = (*pScreen->SetCursorPosition) (pScreen,x,y,generateEvent); + val = (*pScreen->SetCursorPosition) (pDev, pScreen,x,y,generateEvent); SCREEN_EPILOG ( SetCursorPosition, RACSetCursorPosition); return val; diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index ec813e068..5a8509bdb 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -38,7 +38,7 @@ static miPointerSpriteFuncRec xf86CursorSpriteFuncs = { /* Screen functions */ static void xf86CursorInstallColormap(ColormapPtr); -static void xf86CursorRecolorCursor(ScreenPtr, CursorPtr, Bool); +static void xf86CursorRecolorCursor(DeviceIntPtr pDev, ScreenPtr, CursorPtr, Bool); static Bool xf86CursorCloseScreen(int, ScreenPtr); static void xf86CursorQueryBestSize(int, unsigned short*, unsigned short*, ScreenPtr); @@ -181,6 +181,7 @@ xf86CursorInstallColormap(ColormapPtr pMap) static void xf86CursorRecolorCursor( + DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) @@ -192,7 +193,7 @@ xf86CursorRecolorCursor( return; if (ScreenPriv->SWCursor) - (*ScreenPriv->RecolorCursor)(pScreen, pCurs, displayed); + (*ScreenPriv->RecolorCursor)(pDev, pScreen, pCurs, displayed); else xf86RecolorCursor(pScreen, pCurs, displayed); } |