summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWalter Harms <wharms@bfs.de>2019-04-28 17:00:17 +0200
committerWalter Harms <wharms@bfs.de>2019-04-28 17:00:17 +0200
commit64b57b01feef4ddb85392eca013b756b2691106e (patch)
tree3184b777c238d720f8a3c7f538bbb976640eb165 /src
parent3f13df93468658cd48bb63a2d836c60d62494e4a (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/Event.c5
1 files changed, 4 insertions, 1 deletions
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);
}