dix: Add temporary conversion function ConvertBackToXI.
Until the InternalEvents are used throughout the server, we can use this one to drop us back into XI la-la land where every event is the wire format. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
269d4d9f2e
commit
00b03683d0
|
@ -328,3 +328,34 @@ GetXIType(InternalEvent *event)
|
||||||
}
|
}
|
||||||
return xitype;
|
return xitype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME: A temporary solution to make the server bisectable. This code
|
||||||
|
* allocates during SIGIO and makes a number of assumptions about what's in
|
||||||
|
* events. Will be removed soon.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
ConvertBackToXI(EventListPtr events, int num_events)
|
||||||
|
{
|
||||||
|
int count = GetMaximumEventsNum();
|
||||||
|
int num = (num_events == 2) ? 1 : 0;
|
||||||
|
int i;
|
||||||
|
EventListPtr tmp_list = InitEventList(count);
|
||||||
|
|
||||||
|
SetMinimumEventSize(tmp_list, count, 1000); /* just to be sure */
|
||||||
|
|
||||||
|
if (num_events == 2) /* DCCE Event? */
|
||||||
|
{
|
||||||
|
if (EventToXI(events->event, tmp_list, &count))
|
||||||
|
ErrorF("[dix] conversion to XI failed\n");
|
||||||
|
memcpy(events->event, tmp_list->event, events->evlen);
|
||||||
|
events++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EventToXI(events->event, tmp_list, &count))
|
||||||
|
ErrorF("[dix] conversion to XI failed\n");
|
||||||
|
|
||||||
|
for (i = 0; i < count; i++)
|
||||||
|
memcpy((events + i)->event, (tmp_list + i)->event, events->evlen);
|
||||||
|
return (count + num);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue