aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/mi')
-rw-r--r--xorg-server/mi/mi.h4
-rw-r--r--xorg-server/mi/mieq.c33
2 files changed, 20 insertions, 17 deletions
diff --git a/xorg-server/mi/mi.h b/xorg-server/mi/mi.h
index 3db8bfcf1..812edce94 100644
--- a/xorg-server/mi/mi.h
+++ b/xorg-server/mi/mi.h
@@ -196,9 +196,7 @@ extern _X_EXPORT Bool mieqInit(
void
);
-extern _X_EXPORT void mieqResizeEvents(
- int /* min_size */
-);
+extern _X_EXPORT void mieqFini(void);
extern _X_EXPORT void mieqEnqueue(
DeviceIntPtr /*pDev*/,
diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c
index 1b81e4d99..4c6c3bdc6 100644
--- a/xorg-server/mi/mieq.c
+++ b/xorg-server/mi/mieq.c
@@ -110,24 +110,29 @@ mieqInit(void)
miEventQueue.handlers[i] = NULL;
for (i = 0; i < QUEUE_SIZE; i++)
{
- EventListPtr evlist = InitEventList(1);
- if (!evlist)
- FatalError("Could not allocate event queue.\n");
- miEventQueue.events[i].events = evlist;
+ if (miEventQueue.events[i].events == NULL) {
+ EventListPtr evlist = InitEventList(1);
+ if (!evlist)
+ FatalError("Could not allocate event queue.\n");
+ miEventQueue.events[i].events = evlist;
+ }
}
SetInputCheck(&miEventQueue.head, &miEventQueue.tail);
return TRUE;
}
-/* Ensure all events in the EQ are at least size bytes. */
void
-mieqResizeEvents(int min_size)
+mieqFini(void)
{
int i;
-
for (i = 0; i < QUEUE_SIZE; i++)
- SetMinimumEventSize(miEventQueue.events[i].events, 1, min_size);
+ {
+ if (miEventQueue.events[i].events != NULL) {
+ FreeEventList(miEventQueue.events[i].events, 1);
+ miEventQueue.events[i].events = NULL;
+ }
+ }
}
/*
@@ -264,7 +269,7 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent* event)
case ET_ProximityOut:
case ET_Hierarchy:
case ET_DeviceChanged:
- event->device.deviceid = dev->id;
+ event->device_event.deviceid = dev->id;
break;
#if XFreeXDGA
case ET_DGAEvent:
@@ -275,7 +280,7 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent* event)
case ET_RawButtonPress:
case ET_RawButtonRelease:
case ET_RawMotion:
- event->raw.deviceid = dev->id;
+ event->raw_event.deviceid = dev->id;
break;
default:
ErrorF("[mi] Unknown event type (%d), cannot change id.\n",
@@ -294,11 +299,11 @@ FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev,
if (original->any.type == ET_ButtonPress ||
original->any.type == ET_ButtonRelease)
{
- int btn = original->device.detail.button;
+ int btn = original->device_event.detail.button;
if (!sdev->button)
return; /* Should never happen */
- master->device.detail.button = sdev->button->map[btn];
+ master->device_event.detail.button = sdev->button->map[btn];
}
}
@@ -377,8 +382,8 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
case ET_ButtonRelease:
if (dev && screen && screen != DequeueScreen(dev) && !handler) {
DequeueScreen(dev) = screen;
- x = event->device.root_x;
- y = event->device.root_y;
+ x = event->device_event.root_x;
+ y = event->device_event.root_y;
NewCurrentScreen (dev, DequeueScreen(dev), x, y);
}
break;