Added patch to ensure X11 input events are handled even without explicit message loop.