XQuartz: Ignore mach IPC until the appkit thread is ready to avoid possible deadlock (this can be reversed once pbproxy uses server API)
This commit is contained in:
parent
cb912aca3a
commit
9eec2d3e3b
|
@ -69,6 +69,8 @@ static NSEventType keyState[NUM_KEYCODES];
|
||||||
int X11EnableKeyEquivalents = TRUE, quartzFullscreenMenu = FALSE;
|
int X11EnableKeyEquivalents = TRUE, quartzFullscreenMenu = FALSE;
|
||||||
int quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
|
int quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
|
||||||
|
|
||||||
|
static Bool appkitReady = FALSE;
|
||||||
|
|
||||||
extern Bool noTestExtensions;
|
extern Bool noTestExtensions;
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||||
|
@ -122,6 +124,14 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
|
||||||
message msg;
|
message msg;
|
||||||
kern_return_t r;
|
kern_return_t r;
|
||||||
|
|
||||||
|
if(!appkitReady) {
|
||||||
|
#if 0
|
||||||
|
ErrorF("%s: mach_msg failed: Appkit thread not ready\n", __FUNCTION__);
|
||||||
|
spewCallStack();
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
msg.hdr.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_MAKE_SEND, 0);
|
msg.hdr.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_MAKE_SEND, 0);
|
||||||
msg.hdr.msgh_size = sizeof (msg);
|
msg.hdr.msgh_size = sizeof (msg);
|
||||||
msg.hdr.msgh_remote_port = _port;
|
msg.hdr.msgh_remote_port = _port;
|
||||||
|
@ -927,6 +937,8 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
|
||||||
if(!xpbproxy_init())
|
if(!xpbproxy_init())
|
||||||
fprintf(stderr, "Error initializing xpbproxy\n");
|
fprintf(stderr, "Error initializing xpbproxy\n");
|
||||||
|
|
||||||
|
appkitReady = TRUE;
|
||||||
|
|
||||||
[NSApp run];
|
[NSApp run];
|
||||||
/* not reached */
|
/* not reached */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user