This commit is contained in:
roc+%cs.cmu.edu 2005-07-19 23:18:56 +00:00
Родитель ceca37103d
Коммит 32a0d273a5
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -165,8 +165,14 @@ xt_event_polling_timer_callback(gpointer user_data)
display = (Display *)user_data;
ac = XtDisplayToApplicationContext(display);
/* don't starve the primary event queue - just process one event */
if (XtAppPending(ac))
/* We need to process many Xt events here. If we just process
one event we might starve one or more Xt consumers. On the other hand
this could hang the whole app if Xt events come pouring in. So process
up to 20 Xt events right now and save the rest for later. This is a hack,
but it oughta work. We *really* should have out of process plugins.
*/
int eventsToProcess = 20;
while (eventsToProcess-- && XtAppPending(ac))
XtAppProcessEvent(ac, XtIMAll);
/* restart the timer */