From 40855d8000b9b9f4e6c6b4317542378ecf516345 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 4 Jun 2008 12:19:28 -0700 Subject: [PATCH] XQuartz: Removed async debugging sleep (cherry picked from commit 7812a8bdf9fab651ea5c07b852b2999547ec628d) --- hw/xquartz/darwinEvents.c | 4 +++- hw/xquartz/mach-startup/bundle-main.c | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) 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)); } }