|
|
@@ -196,3 +196,32 @@ void EnableOSXDockIcon(bool enable)
|
|
|
[NSApp setActivationPolicy:
|
|
|
NSApplicationActivationPolicyProhibited];
|
|
|
}
|
|
|
+
|
|
|
+/*
|
|
|
+ * This custom NSApplication subclass makes the app compatible with CEF. Qt
|
|
|
+ * also has an NSApplication subclass, but it doesn't conflict thanks to Qt
|
|
|
+ * using arcane magic to hook into the NSApplication superclass itself if the
|
|
|
+ * program has its own NSApplication subclass.
|
|
|
+ */
|
|
|
+
|
|
|
+@protocol CrAppProtocol
|
|
|
+- (BOOL)isHandlingSendEvent;
|
|
|
+@end
|
|
|
+
|
|
|
+@interface OBSApplication : NSApplication <CrAppProtocol>
|
|
|
+@property (nonatomic, getter=isHandlingSendEvent) BOOL handlingSendEvent;
|
|
|
+@end
|
|
|
+
|
|
|
+@implementation OBSApplication
|
|
|
+- (void)sendEvent:(NSEvent *)event
|
|
|
+{
|
|
|
+ _handlingSendEvent = YES;
|
|
|
+ [super sendEvent:event];
|
|
|
+ _handlingSendEvent = NO;
|
|
|
+}
|
|
|
+@end
|
|
|
+
|
|
|
+void InstallNSApplicationSubclass()
|
|
|
+{
|
|
|
+ [OBSApplication sharedApplication];
|
|
|
+}
|