forked from pool/xorg-x11-server
Stefan Dirsch
3da29b8c96
U_0002-animcur-Return-the-next-interval-directly-from-the-t.patch, U_0003-animcur-Run-the-timer-from-the-device-not-the-screen.patch, U_0004-animcur-Fix-transitions-between-animated-cursors.patch * There is a bug in version 1.19 of the X.org X server that can cause an infinite recursion in the animated cursor code, which has been fixed by these patches (boo#1080312) - supersedes u_cursors-animation.patch (boo#1020061) OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=690
72 lines
2.6 KiB
Diff
72 lines
2.6 KiB
Diff
From 26841b2c9ea03fda8b2d0da254e0344fd2a3afce Mon Sep 17 00:00:00 2001
|
|
From: Adam Jackson <ajax@redhat.com>
|
|
Date: Thu, 26 Oct 2017 13:40:57 -0400
|
|
Subject: [PATCH] animcur: Use fixed-size screen private
|
|
|
|
Reviewed-by: Robert Morell <rmorell@nvidia.com>
|
|
Tested-by: Robert Morell <rmorell@nvidia.com>
|
|
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
(cherry picked from commit 3abbdb7318018584a27220737bd92081ce8ee67c)
|
|
---
|
|
render/animcur.c | 16 ++++------------
|
|
1 file changed, 4 insertions(+), 12 deletions(-)
|
|
|
|
diff --git a/render/animcur.c b/render/animcur.c
|
|
index 52e6b8b79..3f85f9a4f 100644
|
|
--- a/render/animcur.c
|
|
+++ b/render/animcur.c
|
|
@@ -77,12 +77,9 @@ static CursorBits animCursorBits = {
|
|
|
|
static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;
|
|
|
|
-#define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec)
|
|
-
|
|
#define IsAnimCur(c) ((c) && ((c)->bits == &animCursorBits))
|
|
#define GetAnimCur(c) ((AnimCurPtr) ((((char *)(c) + CURSOR_REC_SIZE))))
|
|
-#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey))
|
|
-#define SetAnimCurScreen(s,p) dixSetPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey, p)
|
|
+#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, &AnimCurScreenPrivateKeyRec))
|
|
|
|
#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
|
|
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
|
@@ -101,9 +98,7 @@ AnimCurCloseScreen(ScreenPtr pScreen)
|
|
Unwrap(as, pScreen, RealizeCursor);
|
|
Unwrap(as, pScreen, UnrealizeCursor);
|
|
Unwrap(as, pScreen, RecolorCursor);
|
|
- SetAnimCurScreen(pScreen, 0);
|
|
ret = (*pScreen->CloseScreen) (pScreen);
|
|
- free(as);
|
|
return ret;
|
|
}
|
|
|
|
@@ -308,15 +303,13 @@ AnimCurInit(ScreenPtr pScreen)
|
|
{
|
|
AnimCurScreenPtr as;
|
|
|
|
- if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
|
+ if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN,
|
|
+ sizeof(AnimCurScreenRec)))
|
|
return FALSE;
|
|
|
|
- as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec));
|
|
- if (!as)
|
|
- return FALSE;
|
|
+ as = GetAnimCurScreen(pScreen);
|
|
as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen);
|
|
if (!as->timer) {
|
|
- free(as);
|
|
return FALSE;
|
|
}
|
|
as->timer_set = FALSE;
|
|
@@ -329,7 +322,6 @@ AnimCurInit(ScreenPtr pScreen)
|
|
Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor);
|
|
Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
|
|
Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor);
|
|
- SetAnimCurScreen(pScreen, as);
|
|
return TRUE;
|
|
}
|
|
|
|
--
|
|
2.13.6
|
|
|