xserver: Branch 'master' - 2 commits
Adam Jackson
ajax at kemper.freedesktop.org
Wed Feb 14 18:54:50 UTC 2018
render/animcur.c | 7 ++++---
xfixes/cursor.c | 5 ++++-
2 files changed, 8 insertions(+), 4 deletions(-)
New commits:
commit ceaf4277447407a7430b9bc3205462fbdbae0e39
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Feb 12 15:35:05 2018 -0500
xfixes: Restore monitoring of animated cursors
This was broken by:
commit aa6651f83c698e8cc40de61aad36c73ca7a6adcf
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Jun 8 16:23:12 2017 -0400
xfixes: Remove the CursorCurrent array
As of that change we look up the current cursor dynamically instead of
trying to track every time it's set through ->DisplayCursor. That would
work, except the 'bits' of an animated cursor is a transparent 1x1
pixel. So now, look up whether there's an animated cursor, and use its
current frame if so.
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index cb38796c0..d4b68f3af 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -134,8 +134,11 @@ Bool EnableCursor = TRUE;
static CursorPtr
CursorForDevice(DeviceIntPtr pDev)
{
- if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite)
+ if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) {
+ if (pDev->spriteInfo->anim.pCursor)
+ return pDev->spriteInfo->anim.pCursor;
return pDev->spriteInfo->sprite->current;
+ }
return NULL;
}
commit 0b7a5700ad3d65e408a2fae00bdee867a8d2e1a8
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Feb 12 15:35:04 2018 -0500
animcur: Change which CursorPtr we save in external state
Formerly spriteInfo->anim.pCursor would point to the animated cursor (or
NULL if not animated). That value would also be available in
spriteInfo->sprite->current, so instead lets use anim.pCursor to point
to the current animation element.
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/render/animcur.c b/render/animcur.c
index b5d222bc6..65327df65 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -133,7 +133,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
ScreenPtr pScreen = dev->spriteInfo->anim.pScreen;
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
- AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
+ AnimCurPtr ac = GetAnimCur(dev->spriteInfo->sprite->current);
int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor;
@@ -147,6 +147,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
pScreen->DisplayCursor = DisplayCursor;
dev->spriteInfo->anim.elt = elt;
+ dev->spriteInfo->anim.pCursor = ac->elts[elt].pCursor;
return ac->elts[elt].delay;
}
@@ -154,7 +155,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
static void
AnimCurCancelTimer(DeviceIntPtr pDev)
{
- CursorPtr cur = pDev->spriteInfo->anim.pCursor;
+ CursorPtr cur = pDev->spriteInfo->sprite->current;
if (IsAnimCur(cur))
TimerCancel(GetAnimCur(cur)->timer);
@@ -171,7 +172,7 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
Unwrap(as, pScreen, DisplayCursor);
if (IsAnimCur(pCursor)) {
- if (pCursor != pDev->spriteInfo->anim.pCursor) {
+ if (pCursor != pDev->spriteInfo->sprite->current) {
AnimCurPtr ac = GetAnimCur(pCursor);
AnimCurCancelTimer(pDev);
More information about the xorg-commit
mailing list