diff options
author | marha <marha@users.sourceforge.net> | 2009-07-25 20:12:58 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-25 20:12:58 +0000 |
commit | 2553bdd7c359cd87525d367761c86932cec5adff (patch) | |
tree | ae71245933c98474a699d3e392de5820879b2018 /xorg-server/hw/xquartz/xpr/xprCursor.c | |
parent | e2c51f2ee7b0a3ea1a052fc49324057b4a4bbc78 (diff) | |
parent | 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (diff) | |
download | vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.gz vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.bz2 vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.zip |
svn merge file:///D:/svnrepos/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xquartz/xpr/xprCursor.c')
-rw-r--r-- | xorg-server/hw/xquartz/xpr/xprCursor.c | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/xorg-server/hw/xquartz/xpr/xprCursor.c b/xorg-server/hw/xquartz/xpr/xprCursor.c index e084ef90e..4345beea4 100644 --- a/xorg-server/hw/xquartz/xpr/xprCursor.c +++ b/xorg-server/hw/xquartz/xpr/xprCursor.c @@ -29,6 +29,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif @@ -37,7 +39,7 @@ #include "xpr.h" #include "darwin.h" #include "darwinEvents.h" -#include "Xplugin.h" +#include <Xplugin.h> #include "mi.h" #include "scrnintstr.h" @@ -47,6 +49,7 @@ #include "globals.h" #include "servermd.h" #include "dixevents.h" +#include "x-hash.h" typedef struct { int cursorVisible; @@ -54,7 +57,8 @@ typedef struct { miPointerSpriteFuncPtr spriteFuncs; } QuartzCursorScreenRec, *QuartzCursorScreenPtr; -static DevPrivateKey darwinCursorScreenKey = &darwinCursorScreenKey; +static int darwinCursorScreenKeyIndex; +static DevPrivateKey darwinCursorScreenKey = &darwinCursorScreenKeyIndex; #define CURSOR_PRIV(pScreen) ((QuartzCursorScreenPtr) \ dixLookupPrivate(&pScreen->devPrivates, darwinCursorScreenKey)) @@ -181,7 +185,7 @@ load_cursor(CursorPtr src, int screen) * Convert the X cursor representation to native format if possible. */ static Bool -QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) +QuartzRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { if(pCursor == NULL || pCursor->bits == NULL) return FALSE; @@ -197,7 +201,7 @@ QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) * Free the storage space associated with a realized cursor. */ static Bool -QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) +QuartzUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { return TRUE; } @@ -208,7 +212,7 @@ QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) * Set the cursor sprite and position. */ static void -QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) +QuartzSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y) { QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); @@ -235,25 +239,15 @@ QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) } } - /* * QuartzMoveCursor * Move the cursor. This is a noop for us. */ static void -QuartzMoveCursor(ScreenPtr pScreen, int x, int y) +QuartzMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { } - -static miPointerSpriteFuncRec quartzSpriteFuncsRec = { - QuartzRealizeCursor, - QuartzUnrealizeCursor, - QuartzSetCursor, - QuartzMoveCursor -}; - - /* =========================================================================== @@ -289,18 +283,8 @@ QuartzCrossScreen(ScreenPtr pScreen, Bool entering) * */ static void -QuartzWarpCursor(ScreenPtr pScreen, int x, int y) +QuartzWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - static Bool neverMoved = TRUE; - - if (neverMoved) - { - /* Don't move the cursor the first time. This is the - jump-to-center initialization, and it's annoying. */ - neverMoved = FALSE; - return; - } - if (quartzServerVisible) { int sx, sy; @@ -311,8 +295,8 @@ QuartzWarpCursor(ScreenPtr pScreen, int x, int y) CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y)); } - miPointerWarpCursor(pScreen, x, y); - miPointerUpdate(); + miPointerWarpCursor(pDev, pScreen, x, y); + miPointerUpdateSprite(pDev); } @@ -320,8 +304,8 @@ static miPointerScreenFuncRec quartzScreenFuncsRec = { QuartzCursorOffScreen, QuartzCrossScreen, QuartzWarpCursor, - DarwinEQPointerPost, - DarwinEQSwitchScreen + NULL, + NULL }; @@ -383,13 +367,16 @@ QuartzInitCursor(ScreenPtr pScreen) PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; - PointPriv->spriteFuncs = &quartzSpriteFuncsRec; + PointPriv->spriteFuncs->RealizeCursor = QuartzRealizeCursor; + PointPriv->spriteFuncs->UnrealizeCursor = QuartzUnrealizeCursor; + PointPriv->spriteFuncs->SetCursor = QuartzSetCursor; + PointPriv->spriteFuncs->MoveCursor = QuartzMoveCursor; + ScreenPriv->cursorVisible = TRUE; return TRUE; } - /* * QuartzSuspendXCursor * X server is hiding. Restore the Aqua cursor. @@ -410,13 +397,15 @@ QuartzResumeXCursor(ScreenPtr pScreen, int x, int y) WindowPtr pWin; CursorPtr pCursor; - pWin = GetSpriteWindow(); + /* TODO: Tablet? */ + + pWin = GetSpriteWindow(darwinPointer); if (pWin->drawable.pScreen != pScreen) return; - pCursor = GetSpriteCursor(); + pCursor = GetSpriteCursor(darwinPointer); if (pCursor == NULL) return; - QuartzSetCursor(pScreen, pCursor, x, y); + QuartzSetCursor(darwinPointer, pScreen, pCursor, x, y); } |