mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Enable Cocoa multi-threaded mode
This commit is contained in:
parent
bc649e1632
commit
cd49efa84e
@ -763,6 +763,12 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
[super sendEvent:event];
|
[super sendEvent:event];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// No-op thread entry point
|
||||||
|
//
|
||||||
|
- (void)doNothing:(id)object
|
||||||
|
{
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#if defined(_GLFW_USE_MENUBAR)
|
#if defined(_GLFW_USE_MENUBAR)
|
||||||
@ -888,6 +894,11 @@ static GLFWbool initializeAppKit(void)
|
|||||||
// Implicitly create shared NSApplication instance
|
// Implicitly create shared NSApplication instance
|
||||||
[GLFWApplication sharedApplication];
|
[GLFWApplication sharedApplication];
|
||||||
|
|
||||||
|
// Make Cocoa enter multi-threaded mode
|
||||||
|
[NSThread detachNewThreadSelector:@selector(doNothing:)
|
||||||
|
toTarget:NSApp
|
||||||
|
withObject:nil];
|
||||||
|
|
||||||
// In case we are unbundled, make us a proper UI application
|
// In case we are unbundled, make us a proper UI application
|
||||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user