diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index 1e79cd3bc..151aaa0a6 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -101,8 +101,10 @@ static inline void darwinEvents_lock(void) { * when darwinEvents == NULL * * TODO: Cleanup this race more elegantly. + * + * For some reason, xinitrc doesn't run until after this anyways... =/ + * sleep(2); */ - sleep(2); } } diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c index 1c325186a..d7b6c3753 100644 --- a/hw/xquartz/mach-startup/bundle-main.c +++ b/hw/xquartz/mach-startup/bundle-main.c @@ -160,9 +160,7 @@ static void accept_fd_handoff(int connected_fd) { if(launchd_fd == -1) fprintf(stderr, "Error receiving $DISPLAY file descriptor, no descriptor received? %d\n", launchd_fd); - fprintf(stderr, "Received new DISPLAY fd (1): %d\n", launchd_fd); - sleep(10); - fprintf(stderr, "Received new DISPLAY fd (2): %d\n", launchd_fd); + fprintf(stderr, "Received new DISPLAY fd: %d\n", launchd_fd); DarwinListenOnOpenFD(launchd_fd); } @@ -354,6 +352,9 @@ int main(int argc, char **argv, char **envp) { /* Could open the display, start the launcher */ XCloseDisplay(display); + /* TODO: Clean up this race better... givint xinitrc time to run. */ + sleep(2); + return execute(command_from_prefs("app_to_run", DEFAULT_CLIENT)); } }