mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
In [finishLaunching] and [replyToApplicationShouldTerminate:] use
[NSWorkspace activeApplication] to get application information. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16766 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b52b96da8d
commit
c4d2bc49f1
1 changed files with 2 additions and 14 deletions
|
@ -691,7 +691,6 @@ static NSCell* tileCell = nil;
|
|||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
|
||||
NSString *filePath;
|
||||
NSDictionary *userInfo;
|
||||
NSArray *windows_list;
|
||||
unsigned count;
|
||||
unsigned i;
|
||||
|
@ -827,18 +826,11 @@ static NSCell* tileCell = nil;
|
|||
[nc postNotificationName: NSApplicationDidFinishLaunchingNotification
|
||||
object: self];
|
||||
|
||||
userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[[NSProcessInfo processInfo] processName], @"NSApplicationName",
|
||||
[[NSBundle mainBundle] bundlePath], @"NSApplicationPath",
|
||||
[NSNumber numberWithInt: [[NSProcessInfo processInfo] processIdentifier]],
|
||||
@"NSApplicationProcessIdentifier",
|
||||
nil];
|
||||
|
||||
NS_DURING
|
||||
[[workspace notificationCenter]
|
||||
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
|
||||
object: workspace
|
||||
userInfo: userInfo];
|
||||
userInfo: [workspace activeApplication]];
|
||||
NS_HANDLER
|
||||
NSLog (_(@"Problem during launch app notification: %@"),
|
||||
[localException reason]);
|
||||
|
@ -2363,7 +2355,6 @@ image.
|
|||
{
|
||||
if (shouldTerminate)
|
||||
{
|
||||
NSDictionary *userInfo;
|
||||
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
|
||||
|
||||
[nc postNotificationName: NSApplicationWillTerminateNotification
|
||||
|
@ -2377,13 +2368,10 @@ image.
|
|||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
/* Tell the Workspace that we really did terminate. */
|
||||
userInfo = [NSDictionary dictionaryWithObject:
|
||||
[[NSProcessInfo processInfo] processName] forKey:
|
||||
@"NSApplicationName"];
|
||||
[[workspace notificationCenter]
|
||||
postNotificationName: NSWorkspaceDidTerminateApplicationNotification
|
||||
object: workspace
|
||||
userInfo: userInfo];
|
||||
userInfo: [workspace activeApplication]];
|
||||
|
||||
/* Destroy the main run loop pool (this also destroys any nested
|
||||
pools which might have been created inside this one). */
|
||||
|
|
Loading…
Reference in a new issue