diff options
Diffstat (limited to 'hw/xfree86/ramdac')
-rw-r--r-- | hw/xfree86/ramdac/xf86Cursor.h | 16 | ||||
-rw-r--r-- | hw/xfree86/ramdac/xf86HWCurs.c | 8 |
2 files changed, 20 insertions, 4 deletions
diff --git a/hw/xfree86/ramdac/xf86Cursor.h b/hw/xfree86/ramdac/xf86Cursor.h index 320ec0ce6..11a03b67b 100644 --- a/hw/xfree86/ramdac/xf86Cursor.h +++ b/hw/xfree86/ramdac/xf86Cursor.h @@ -16,6 +16,7 @@ typedef struct _xf86CursorInfoRec { Bool (*LoadCursorImageCheck) (ScrnInfoPtr pScrn, unsigned char *bits); void (*HideCursor) (ScrnInfoPtr pScrn); void (*ShowCursor) (ScrnInfoPtr pScrn); + Bool (*ShowCursorCheck) (ScrnInfoPtr pScrn); unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr); Bool (*UseHWCursor) (ScreenPtr, CursorPtr); @@ -41,6 +42,21 @@ xf86DriverLoadCursorImage(xf86CursorInfoPtr infoPtr, unsigned char *bits) } static inline Bool +xf86DriverHasShowCursor(xf86CursorInfoPtr infoPtr) +{ + return infoPtr->ShowCursorCheck || infoPtr->ShowCursor; +} + +static inline Bool +xf86DriverShowCursor(xf86CursorInfoPtr infoPtr) +{ + if(infoPtr->ShowCursorCheck) + return infoPtr->ShowCursorCheck(infoPtr->pScrn); + infoPtr->ShowCursor(infoPtr->pScrn); + return TRUE; +} + +static inline Bool xf86DriverHasLoadCursorARGB(xf86CursorInfoPtr infoPtr) { return infoPtr->LoadCursorARGBCheck || infoPtr->LoadCursorARGB; diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c index 7043a9c72..2e4c9e519 100644 --- a/hw/xfree86/ramdac/xf86HWCurs.c +++ b/hw/xfree86/ramdac/xf86HWCurs.c @@ -93,7 +93,8 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) if (!infoPtr->SetCursorPosition || !xf86DriverHasLoadCursorImage(infoPtr) || !infoPtr->HideCursor || - !infoPtr->ShowCursor || !infoPtr->SetCursorColors) + !xf86DriverHasShowCursor(infoPtr) || + !infoPtr->SetCursorColors) return FALSE; if (infoPtr->RealizeCursor) { @@ -224,8 +225,7 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y); - (*infoPtr->ShowCursor) (infoPtr->pScrn); - return TRUE; + return xf86DriverShowCursor(infoPtr); } Bool @@ -287,7 +287,7 @@ xf86SetTransparentCursor(ScreenPtr pScreen) xf86DriverLoadCursorImage (infoPtr, ScreenPriv->transparentData); - (*infoPtr->ShowCursor) (infoPtr->pScrn); + xf86DriverShowCursor(infoPtr); input_unlock(); } |