diff --git a/ChangeLog b/ChangeLog index b2e8b6581..61f0a0300 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Oct 19 1999 Richard Frith-Macdonald + + * Source/NSApplication.m: ([-terminate:]) modification based on + patch by Aled.Davies@bigfoot.com to send notification. + * Source/NSWorkspace.m: Fix to prevent duplicate notifications. + Tue Oct 19 1999 Nicola Pero Changing suggested by Richard: diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 3f9af42e3..eb5e14b1b 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -1493,12 +1493,24 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException); if (shouldTerminate) { + NSDictionary *userInfo; + app_should_quit = YES; /* * add dummy event to queue to assure loop cycles * at least one more time */ DPSPostEvent(GSCurrentContext(), null_event, NO); + + /* + * Tell the Workspace that we really did terminate + */ + userInfo = [NSDictionary dictionaryWithObject: + [[NSProcessInfo processInfo] processName] forKey: @"NSApplicationName"]; + [[[NSWorkspace sharedWorkspace] notificationCenter] + postNotificationName: NSWorkspaceDidTerminateApplicationNotification + object: self + userInfo: userInfo]; } } diff --git a/Source/NSWorkspace.m b/Source/NSWorkspace.m index 207ddb0c3..53e8b4147 100644 --- a/Source/NSWorkspace.m +++ b/Source/NSWorkspace.m @@ -83,7 +83,9 @@ static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification"; } /* - * Post notification both locally and remotely. + * Post notification remotely - since we are listening for distributed + * notifications, we will observe the notification arriving from the + * distributed notification center, and it will get sent out locally too. */ - (void) postNotification: (NSNotification*)aNotification { @@ -93,7 +95,6 @@ static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification"; object: GSWorkspaceNotification userInfo: [aNotification userInfo]]; [remote postNotification: rem]; - [super postNotification: aNotification]; } - (void) postNotificationName: (NSString*)name