aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi/mieq.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/mi/mieq.c')
-rw-r--r--xorg-server/mi/mieq.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c
index 974bec77d..66e2806c7 100644
--- a/xorg-server/mi/mieq.c
+++ b/xorg-server/mi/mieq.c
@@ -387,7 +387,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;
@@ -445,14 +445,15 @@ mieqProcessInputEvents(void)
evlen = e->events->evlen;
if(evlen > event_size)
- {
+ {
event = realloc(event, evlen);
- event_size = evlen;
- }
+ event_size=evlen;
+
+ if (!event)
+ FatalError("[mi] No memory left for event processing.\n");
+ }
- if (!event)
- FatalError("[mi] No memory left for event processing.\n");
memcpy(event, e->events->event, evlen);