Community
Participate
Working Groups
Currently Display.sleep() waits "until an event is received or it is otherwise awakened" ... So it can't be used in situations where (beside the UI) there are other flags to check e.g. while(!someOtherTask.isDone() && !display.isDisposed()) { if(!display.readAndDispatch()) { display.sleep(); } } because there is no fuarante to be wake up if no event happens (e.g. the loop might hang if the app has no focus and thus no repaints or mouse/key events happen). For such cases it would be good to have a variant of this to Display.sleep(timeout) where it waits "until an event is received, the given timeout has elapsed, or it is otherwise awakened." no precise timing is required here of course just some kind of upper bound. At least on GTK it seems there is already a wait with timout (50ms) happening.