summaryrefslogtreecommitdiff
path: root/xfixes/cursor.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-31 14:38:35 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-03 10:11:48 +1000
commit664ac92d8bbe956dd6fd80fac5dc3161028803b2 (patch)
tree1311feeecbacccf8b1f40e3a3a70b8ea45bfba46 /xfixes/cursor.c
parentf48dfcc1b772a09428e328c72124ea0d46a73416 (diff)
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 <http://bugs.freedesktop.org/show_bug.cgi?id=23034>
Diffstat (limited to 'xfixes/cursor.c')
-rw-r--r--xfixes/cursor.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 45891bbe1..acc703a42 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);