From 387607d8caa1268fb491099f2f2ac0dc150e9dd1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 31 Jul 2009 14:38:35 +1000 Subject: [PATCH] xfixes: backup the DisplayCursor/CloseScreen proc before restoring it (#23034) The screen's DisplayCursor func is wrapped as AnimCurDisplayCursor -> CursorDisplayCursor -> miPointerDisplayCursor. Calling CursorDisplayCursor while an animated cursor was currently displayed would remove AnimCurDisplayCursor from the wrap stack. Thus, the next call to ChangeToCursor wouldn't update the animated cursor state. The block handler for animated cursors would then continuously overwrite the actual cursor, leaving an animated cursor everywhere on the screen. X.Org Bug 23034 --- xfixes/cursor.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 45891bb..acc703a 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -131,7 +131,7 @@ typedef struct _CursorScreen { #define GetCursorScreenIfSet(s) GetCursorScreen(s) #define SetCursorScreen(s,p) dixSetPrivate(&(s)->devPrivates, CursorScreenPrivateKey, p) #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) -#define Unwrap(as,s,elt) ((s)->elt = (as)->elt) +#define Unwrap(as,s,elt,backup) (((backup) = (s)->elt), (s)->elt = (as)->elt) /* The cursor doesn't show up until the first XDefineCursor() */ static Bool CursorVisible = FALSE; @@ -145,8 +145,9 @@ CursorDisplayCursor (DeviceIntPtr pDev, { CursorScreenPtr cs = GetCursorScreen(pScreen); Bool ret; + DisplayCursorProcPtr backupProc; - Unwrap (cs, pScreen, DisplayCursor); + Unwrap (cs, pScreen, DisplayCursor, backupProc); /* * Have to check ConnectionInfo to distinguish client requests from @@ -184,7 +185,8 @@ CursorDisplayCursor (DeviceIntPtr pDev, } } } - Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); + Wrap (cs, pScreen, DisplayCursor, backupProc); + return ret; } @@ -193,9 +195,11 @@ CursorCloseScreen (int index, ScreenPtr pScreen) { CursorScreenPtr cs = GetCursorScreen (pScreen); Bool ret; + CloseScreenProcPtr close_proc; + DisplayCursorProcPtr display_proc; - Unwrap (cs, pScreen, CloseScreen); - Unwrap (cs, pScreen, DisplayCursor); + Unwrap (cs, pScreen, CloseScreen, close_proc); + Unwrap (cs, pScreen, DisplayCursor, display_proc); deleteCursorHideCountsForScreen(pScreen); ret = (*pScreen->CloseScreen) (index, pScreen); xfree (cs); -- 1.6.3.rc1.2.g0164.dirty