sync with gy (use gy_gtk_main/gy_gtk_idler_maybe_quit)