aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/devices.c4
-rw-r--r--xorg-server/dix/events.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index f419a98fd..e65e5598e 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -920,6 +920,10 @@ CloseDownDevices(void)
{
if (!IsMaster(dev) && dev->u.master)
dev->u.master = NULL;
+ /* Initialise the sprite and paired members of all devices
+ to avoid crashes in CloseDevice later */
+ dev->spriteInfo->sprite=NULL;
+ dev->spriteInfo->paired=NULL;
}
CloseDeviceList(&inputInfo.devices);
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 22bb99557..7d8c1493f 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -2746,6 +2746,9 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev)
CHECKEVENT(ev);
+ if (!pSprite)
+ return FALSE;
+
prevSpriteWin = pSprite->win;
if (ev && !syncEvents.playingEvents)
@@ -3152,7 +3155,7 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
}
} else
#endif
- if (newScreen != pSprite->hotPhys.pScreen)
+ if (newScreen != pSprite->hotPhys.pScreen && WindowTable[newScreen->myNum])
ConfineCursorToWindow(pDev, WindowTable[newScreen->myNum],
TRUE, FALSE);
}