From 8d9defe8c2a685709318c1d43379443df3d2322a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 24 Sep 2008 10:11:00 -0400 Subject: [PATCH] Fix un-suppressing the initial cursor. The intended behaviour was "show as soon as someone calls XDefineCursor". What you actually got was, uh, slightly less well defined, since the screen's ChangeWindowAttributes hook would run after DIX handled the cursor change. Oops. The trivial way to turn the cursor on is: % xsetroot -cursor_name gumby Refer to /usr/include/X11/cursorfont.h for cursor names. Thanks to anholt for catching this. --- xfixes/cursor.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 4b85b7089..2a42a0b2c 100755 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -111,7 +111,6 @@ typedef struct _CursorHideCountRec { typedef struct _CursorScreen { DisplayCursorProcPtr DisplayCursor; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; CloseScreenProcPtr CloseScreen; CursorHideCountPtr pCursorHideCounts; } CursorScreenRec, *CursorScreenPtr; @@ -135,6 +134,13 @@ CursorDisplayCursor (DeviceIntPtr pDev, Unwrap (cs, pScreen, DisplayCursor); + /* + * 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->DisplayCursor) (pDev, pScreen, pInvisibleCursor); } else { @@ -167,27 +173,6 @@ CursorDisplayCursor (DeviceIntPtr pDev, return ret; } -static Bool -CursorChangeWindowAttributes(WindowPtr pWin, unsigned long mask) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - CursorScreenPtr cs = GetCursorScreen(pScreen); - Bool ret; - - /* - * Have to check ConnectionInfo to distinguish client requests from - * initial root window setup. Not a great way to do it, I admit. - */ - if ((mask & CWCursor) && ConnectionInfo) - CursorVisible = TRUE; - - Unwrap(cs, pScreen, ChangeWindowAttributes); - ret = pScreen->ChangeWindowAttributes(pWin, mask); - Wrap(cs, pScreen, ChangeWindowAttributes, CursorChangeWindowAttributes); - - return ret; -} - static Bool CursorCloseScreen (int index, ScreenPtr pScreen) { @@ -196,7 +181,6 @@ CursorCloseScreen (int index, ScreenPtr pScreen) Unwrap (cs, pScreen, CloseScreen); Unwrap (cs, pScreen, DisplayCursor); - Unwrap (cs, pScreen, ChangeWindowAttributes); deleteCursorHideCountsForScreen(pScreen); ret = (*pScreen->CloseScreen) (index, pScreen); xfree (cs); @@ -1074,8 +1058,6 @@ XFixesCursorInit (void) return FALSE; Wrap (cs, pScreen, CloseScreen, CursorCloseScreen); Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); - Wrap (cs, pScreen, ChangeWindowAttributes, - CursorChangeWindowAttributes); cs->pCursorHideCounts = NULL; SetCursorScreen (pScreen, cs); }