Fix Tidal authentication on macOS
This commit is contained in:
@@ -148,8 +148,11 @@ QDebug operator<<(QDebug dbg, NSObject* object) {
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
|
||||
|
||||
Q_UNUSED(aNotification);
|
||||
|
||||
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL];
|
||||
|
||||
key_tap_ = [ [SPMediaKeyTap alloc] initWithDelegate:self];
|
||||
if ([SPMediaKeyTap usesGlobalMediaKeyTap]) {
|
||||
if ([key_tap_ startWatchingMediaKeys]) {
|
||||
@@ -187,6 +190,13 @@ QDebug operator<<(QDebug dbg, NSObject* object) {
|
||||
|
||||
}
|
||||
|
||||
- (void)handleURLEvent:(NSAppleEventDescriptor*)theEvent withReplyEvent:(NSAppleEventDescriptor*)replyEvent {
|
||||
|
||||
NSString *url = [[theEvent paramDescriptorForKeyword:keyDirectObject] stringValue];
|
||||
application_handler_->LoadUrl(QString::fromNSString(url));
|
||||
|
||||
}
|
||||
|
||||
- (void) mediaKeyTap: (SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event {
|
||||
#pragma unused(keyTap)
|
||||
[self handleMediaEvent:event];
|
||||
|
||||
Reference in New Issue
Block a user