[comp.windows.x] X intrinsics bug

rjohn@P776-2S.HAC.COM (Richard Johnson) (07/21/89)

Please forward this bug report to the folks at MIT, etc.

If there are no displays (x server connections) made from an application
then the X intrinsics will not perform callback services on "other"
input sources (ones set up with XtAppAddInput or XtAppAddTimeOut). 
"Other" input is given a chance along with all the x server connections
in a round robin fashion but only if there is at least one x server
connection.

the following change was made to lib/Xt/NextEvent.c:XtAppNextEvent
to fix this problem:

561,569c561,571
<       for (i = 1; i <= app->count; i++) {
<           d = (i + app->last) % app->count;
<           if (d == 0) DoOtherSources(app);
<           if (XEventsQueued(app->list[d], QueuedAfterFlush) > 0) {
<               XNextEvent(app->list[d], event);
<               app->last = d;
<               if (event->xany.type == MappingNotify)
<                   _RefreshMapping(event);
<               return;
---
>       if (app->count > 0) {
>           for (i = 1; i <= app->count; i++) {
>               d = (i + app->last) % app->count;
>               if (d == 0) DoOtherSources(app);
>               if (XEventsQueued(app->list[d], QueuedAfterFlush) > 0) {
>                   XNextEvent(app->list[d], event);
>                   app->last = d;
>                   if (event->xany.type == MappingNotify)
>                       _RefreshMapping(event);
>                   return;
>               }
571a574,577
>       else {
>           DoOtherSources(app);
>       }
>