aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/Xi/exevents.c5
-rw-r--r--xorg-server/dix/devices.c4
-rw-r--r--xorg-server/dix/events.c5
-rw-r--r--xorg-server/mi/mieq.c2
4 files changed, 13 insertions, 3 deletions
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 94c9fd709..dd2d4739b 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -928,6 +928,7 @@ ProcessRawEvent(RawDeviceEvent *ev, DeviceIntPtr device)
}
for (i = 0; i < screenInfo.numScreens; i++)
+ if (WindowTable[i])
DeliverEventsToWindow(device, WindowTable[i], xi, 1,
GetEventFilter(device, xi), NULL);
free(xi);
@@ -969,7 +970,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
{
kbd = GetPairedDevice(device);
mouse = device;
- if (!kbd->key) /* can happen with floating SDs */
+ if (kbd && !kbd->key) /* can happen with floating SDs */
kbd = NULL;
} else
{
@@ -1027,6 +1028,8 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
case ET_KeyRelease:
case ET_ProximityIn:
case ET_ProximityOut:
+ if (!device->spriteInfo->sprite)
+ return;
GetSpritePosition(device, &rootX, &rootY);
event->root_x = rootX;
event->root_y = rootY;
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);
}
diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c
index a400fe29b..707d0f8ff 100644
--- a/xorg-server/mi/mieq.c
+++ b/xorg-server/mi/mieq.c
@@ -381,7 +381,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
case ET_KeyRelease:
case ET_ButtonPress:
case ET_ButtonRelease:
- if (dev && screen && screen != DequeueScreen(dev) && !handler) {
+ if (dev && screen && dev->spriteInfo->sprite && screen != DequeueScreen(dev) && !handler) {
DequeueScreen(dev) = screen;
x = event->device_event.root_x;
y = event->device_event.root_y;