bugfix: lost events in XWindow due to 'select' when events are ready