diff options
-rw-r--r-- | dix/eventconvert.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c index 2ade378f8..31fb47be2 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -328,3 +328,34 @@ GetXIType(InternalEvent *event) } 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); +} |