Cocoa Port: Fix a bug where HID devices would fail to be detected on startup when running on macOS High Sierra.
This commit is contained in:
parent
8448b3ee10
commit
208f99f4a6
|
@ -2238,6 +2238,7 @@
|
|||
|
||||
[inputManager setMappingsWithMappings:userMappings];
|
||||
[[inputManager hidManager] setDeviceListController:inputDeviceListController];
|
||||
[[inputManager hidManager] setRunLoop:[NSRunLoop currentRunLoop]];
|
||||
|
||||
// Set the microphone settings per user preferences.
|
||||
[[cdsCore cdsController] setHardwareMicMute:[[NSUserDefaults standardUserDefaults] boolForKey:@"Microphone_HardwareMicMute"]];
|
||||
|
|
|
@ -116,13 +116,18 @@ static NSDictionary *hidUsageTable = nil;
|
|||
CFRelease(elementArray);
|
||||
|
||||
// Set up force feedback.
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
if (IsOSXVersionSupported(10, 6, 0))
|
||||
{
|
||||
ioService = IOHIDDeviceGetService(hidDeviceRef);
|
||||
if (ioService != MACH_PORT_NULL)
|
||||
{
|
||||
IOObjectRetain(ioService);
|
||||
}
|
||||
}
|
||||
else
|
||||
#else
|
||||
{
|
||||
ioService = MACH_PORT_NULL;
|
||||
|
||||
CFMutableDictionaryRef matchingDict = IOServiceMatching(kIOHIDDeviceKey);
|
||||
|
@ -143,6 +148,7 @@ static NSDictionary *hidUsageTable = nil;
|
|||
CFRelease(matchingDict);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
ffDevice = NULL;
|
||||
|
@ -865,7 +871,6 @@ void HandleQueueValueAvailableCallback(void *inContext, IOReturn inResult, void
|
|||
CFRelease(cfGenericControllerMatcher);
|
||||
|
||||
spinlockRunLoop = OS_SPINLOCK_INIT;
|
||||
[self setRunLoop:[NSRunLoop currentRunLoop]];
|
||||
|
||||
IOReturn result = IOHIDManagerOpen(hidManagerRef, kIOHIDOptionsTypeNone);
|
||||
if (result != kIOReturnSuccess)
|
||||
|
|
Loading…
Reference in New Issue