add option to disable GMainLoop, use with care