fix event loop blocking in x window