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
selector: @selector (broadcastMessageCallback:)
name: getBroadcastEventName()
object: nil];
object: nil
suspensionBehavior: NSNotificationSuspensionBehaviorDeliverImmediately];
}
else
{
@@ -126,7 +127,7 @@ private:
static NSApplicationTerminateReply applicationShouldTerminate (id /*self*/, SEL, NSApplication*)
{
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
if (auto* app = JUCEApplicationBase::getInstance())
{
app->systemRequestedQuit();
@@ -144,7 +145,7 @@ private:
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));
return YES;
@@ -155,7 +156,7 @@ private:
static void application_openFiles (id /*self*/, SEL, NSApplication*, NSArray* filenames)
{
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
if (auto* app = JUCEApplicationBase::getInstance())
{
StringArray files;
@@ -200,7 +201,7 @@ private:
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]));
}


Loading…
Cancel
Save