From 64b57b01feef4ddb85392eca013b756b2691106e Mon Sep 17 00:00:00 2001 From: Walter Harms Date: Sun, 28 Apr 2019 17:00:17 +0200 Subject: Fix input starvation in XtMainLoop() closes bug #7 the function XtAppProcessEvent() can handle only one of XtIMXEvent | XtIMTimer | XtIMAlternateInput | XtIMSignal propperly. It returns after processing one type of input others are left unprocessed. putting enought input of one type, the later once will never processed. --- src/Event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Event.c b/src/Event.c index de52910..e3d977e 100644 --- a/src/Event.c +++ b/src/Event.c @@ -1549,9 +1549,12 @@ void XtMainLoop(void) void XtAppMainLoop( XtAppContext app) { + long m = XtIMAll; LOCK_APP(app); do { - XtAppProcessEvent(app, XtIMAll); + if( m == 0 ) m=XtIMAll; + XtAppProcessEvent(app, m); + m >>= 1; } while(app->exit_flag == FALSE); UNLOCK_APP(app); } -- cgit v1.2.3