switch to GLib's GMainLoop