object:self];
}
+- (void)applicationWillBecomeActive:(NSNotification *)notification {
+ [self restoreToForeground:notification];
+}
+
- (void)transformIntoElement:(id)sender {
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
}
- (void)hidManager:(NJHIDManager *)manager didError:(NSError *)error {
- [outlineView.window presentError:error
- modalForWindow:outlineView.window
- delegate:nil
- didPresentSelector:nil
- contextInfo:nil];
+ // Since the error shows the window, it can trigger another attempt
+ // to re-open the HID manager, which will also probably fail and error,
+ // so don't bother repeating ourselves.
+ if (!outlineView.window.attachedSheet) {
+ [NSApplication.sharedApplication activateIgnoringOtherApps:YES];
+ [outlineView.window makeKeyAndOrderFront:nil];
+ [outlineView.window presentError:error
+ modalForWindow:outlineView.window
+ delegate:nil
+ didPresentSelector:nil
+ contextInfo:nil];
+ }
+ self.translatingEvents = NO;
+ if (manager.running)
+ [self hidManagerDidStart:manager];
+ else
+ [self hidManagerDidStop:manager];
}
- (void)hidManagerDidStart:(NJHIDManager *)manager {
if (!translatingEvents && !NSApplication.sharedApplication.isActive)
[self stopHid];
- else if (translatingEvents || NSApplication.sharedApplication.isActive)
+ else
[self startHid];
}
}
IOHIDManagerClose(manager, kIOHIDOptionsTypeNone);
CFRelease(manager);
[self.delegate hidManager:self didError:error];
+ NSLog(@"Error starting HID manager: %@.", error);
} else {
_manager = manager;
IOHIDManagerScheduleWithRunLoop(_manager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>228</string>
+ <string>244</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>NSHumanReadableCopyright</key>