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/xfixes/cursor.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/xfixes/cursor.c')
-rw-r--r-- | xorg-server/xfixes/cursor.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c index ba2e36775..15e0948bb 100644 --- a/xorg-server/xfixes/cursor.c +++ b/xorg-server/xfixes/cursor.c @@ -58,10 +58,12 @@ static RESTYPE CursorClientType; static RESTYPE CursorHideCountType; static RESTYPE CursorWindowType; -static DevPrivateKey CursorScreenPrivateKey = &CursorScreenPrivateKey; static CursorPtr CursorCurrent; static CursorPtr pInvisibleCursor = NULL; +static int CursorScreenPrivateKeyIndex; +static DevPrivateKey CursorScreenPrivateKey = &CursorScreenPrivateKeyIndex; + static void deleteCursorHideCountsForScreen (ScreenPtr pScreen); #define VERIFY_CURSOR(pCursor, cursor, client, access) { \ @@ -72,7 +74,7 @@ static void deleteCursorHideCountsForScreen (ScreenPtr pScreen); return BadCursor; \ } \ } - + /* * There is a global list of windows selecting for cursor events */ @@ -121,8 +123,12 @@ typedef struct _CursorScreen { #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) +/* The cursor doesn't show up until the first XDefineCursor() */ +static Bool CursorVisible = FALSE; + static Bool -CursorDisplayCursor (ScreenPtr pScreen, +CursorDisplayCursor (DeviceIntPtr pDev, + ScreenPtr pScreen, CursorPtr pCursor) { CursorScreenPtr cs = GetCursorScreen(pScreen); @@ -130,10 +136,18 @@ CursorDisplayCursor (ScreenPtr pScreen, Unwrap (cs, pScreen, DisplayCursor); - if (cs->pCursorHideCounts != NULL) { - ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor); + /* + * Have to check ConnectionInfo to distinguish client requests from + * initial root window setup. Not a great way to do it, I admit. + */ + if (ConnectionInfo) + CursorVisible = TRUE; + + if (cs->pCursorHideCounts != NULL || !CursorVisible) { + ret = ((*pScreen->RealizeCursor)(pDev, pScreen, pInvisibleCursor) && + (*pScreen->DisplayCursor) (pDev, pScreen, pInvisibleCursor)); } else { - ret = (*pScreen->DisplayCursor) (pScreen, pCursor); + ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); } if (pCursor != CursorCurrent) @@ -356,7 +370,7 @@ ProcXFixesGetCursorImage (ClientPtr client) pCursor, RT_NONE, NULL, DixReadAccess); if (rc != Success) return rc; - GetSpritePosition (&x, &y); + GetSpritePosition (PickPointer(client), &x, &y); width = pCursor->bits->width; height = pCursor->bits->height; npixels = width * height; @@ -508,7 +522,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) pCursor, RT_NONE, NULL, DixReadAccess|DixGetAttrAccess); if (rc != Success) return rc; - GetSpritePosition (&x, &y); + GetSpritePosition (PickPointer(client), &x, &y); width = pCursor->bits->width; height = pCursor->bits->height; npixels = width * height; @@ -881,7 +895,7 @@ ProcXFixesHideCursor (ClientPtr client) ret = createCursorHideCount(client, pWin->drawable.pScreen); if (ret == Success) { - (void) CursorDisplayCursor(pWin->drawable.pScreen, CursorCurrent); + (void) CursorDisplayCursor(PickPointer(client), pWin->drawable.pScreen, CursorCurrent); } return ret; @@ -975,7 +989,7 @@ CursorFreeHideCount (pointer data, XID id) ScreenPtr pScreen = pChc->pScreen; deleteCursorHideCount(pChc, pChc->pScreen); - (void) CursorDisplayCursor(pScreen, CursorCurrent); + (void) CursorDisplayCursor(inputInfo.pointer, pScreen, CursorCurrent); return 1; } @@ -1033,6 +1047,9 @@ Bool XFixesCursorInit (void) { int i; + + if (party_like_its_1989) + CursorVisible = TRUE; for (i = 0; i < screenInfo.numScreens; i++) { |