mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-27 21:22:26 +00:00
XQuartz: Make the DarwinProcessFDAdditionQueue_thread wait 3 seconds to allow xinitrc to catch up
Previously, we weren't always waiting the full three seconds. This should be better, but is still sub-optimal. We really want to start processing these once a WM has been started. http://xquartz.macosforge.org/trac/ticket/416 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
b3d2164a03
commit
7524dbd061
2 changed files with 23 additions and 16 deletions
|
|
@ -47,7 +47,6 @@
|
|||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <mach/mach.h>
|
||||
|
|
@ -204,7 +203,6 @@ static void socket_handoff_thread(void *arg) {
|
|||
socket_handoff_t *handoff_data = (socket_handoff_t *)arg;
|
||||
int launchd_fd = -1;
|
||||
int connected_fd;
|
||||
unsigned remain;
|
||||
|
||||
/* Now actually get the passed file descriptor from this connection
|
||||
* If we encounter an error, keep listening.
|
||||
|
|
@ -227,20 +225,7 @@ static void socket_handoff_thread(void *arg) {
|
|||
close(handoff_data->fd);
|
||||
unlink(handoff_data->filename);
|
||||
free(handoff_data);
|
||||
|
||||
/* TODO: Clean up this race better... giving xinitrc time to run... need to wait for 1.5 branch:
|
||||
*
|
||||
* From ajax:
|
||||
* There's already an internal callback chain for setting selection [in 1.5]
|
||||
* ownership. See the CallSelectionCallback at the bottom of
|
||||
* ProcSetSelectionOwner, and xfixes/select.c for an example of how to hook
|
||||
* into it.
|
||||
*/
|
||||
|
||||
remain = 3000000;
|
||||
fprintf(stderr, "X11.app: Received new $DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd);
|
||||
while((remain = usleep(remain)) > 0);
|
||||
|
||||
|
||||
fprintf(stderr, "X11.app Handing off fd to server thread via DarwinListenOnOpenFD(%d)\n", launchd_fd);
|
||||
DarwinListenOnOpenFD(launchd_fd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue