Browse Source

Tweaked the OSX broadcast notification flags to avoid problems with anotherInstanceStarted()

tags/2021-05-28
jules 8 years ago
parent
commit
6b5be8d9ef
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      modules/juce_events/native/juce_mac_MessageManager.mm

+ 6
- 5
modules/juce_events/native/juce_mac_MessageManager.mm View File

@@ -52,7 +52,8 @@ public:
[[NSDistributedNotificationCenter defaultCenter] addObserver: delegate [[NSDistributedNotificationCenter defaultCenter] addObserver: delegate
selector: @selector (broadcastMessageCallback:) selector: @selector (broadcastMessageCallback:)
name: getBroadcastEventName() name: getBroadcastEventName()
object: nil];
object: nil
suspensionBehavior: NSNotificationSuspensionBehaviorDeliverImmediately];
} }
else else
{ {
@@ -126,7 +127,7 @@ private:
static NSApplicationTerminateReply applicationShouldTerminate (id /*self*/, SEL, NSApplication*) static NSApplicationTerminateReply applicationShouldTerminate (id /*self*/, SEL, NSApplication*)
{ {
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
if (auto* app = JUCEApplicationBase::getInstance())
{ {
app->systemRequestedQuit(); app->systemRequestedQuit();
@@ -144,7 +145,7 @@ private:
static BOOL application_openFile (id /*self*/, SEL, NSApplication*, NSString* filename) static BOOL application_openFile (id /*self*/, SEL, NSApplication*, NSString* filename)
{ {
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
if (auto* app = JUCEApplicationBase::getInstance())
{ {
app->anotherInstanceStarted (quotedIfContainsSpaces (filename)); app->anotherInstanceStarted (quotedIfContainsSpaces (filename));
return YES; return YES;
@@ -155,7 +156,7 @@ private:
static void application_openFiles (id /*self*/, SEL, NSApplication*, NSArray* filenames) static void application_openFiles (id /*self*/, SEL, NSApplication*, NSArray* filenames)
{ {
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
if (auto* app = JUCEApplicationBase::getInstance())
{ {
StringArray files; StringArray files;
@@ -200,7 +201,7 @@ private:
static void getUrl_withReplyEvent (id /*self*/, SEL, NSAppleEventDescriptor* event, NSAppleEventDescriptor*) static void getUrl_withReplyEvent (id /*self*/, SEL, NSAppleEventDescriptor* event, NSAppleEventDescriptor*)
{ {
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
if (auto* app = JUCEApplicationBase::getInstance())
app->anotherInstanceStarted (quotedIfContainsSpaces ([[event paramDescriptorForKeyword: keyDirectObject] stringValue])); app->anotherInstanceStarted (quotedIfContainsSpaces ([[event paramDescriptorForKeyword: keyDirectObject] stringValue]));
} }


Loading…
Cancel
Save