mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Application launch fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4996 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c27b641394
commit
1334dec400
3 changed files with 52 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
Tue Oct 12 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSApplication.m: Attempts to fix ordering of application
|
||||
activation und unhiding on launch.
|
||||
* Source/NSWorkspace.m: Patch by Aled.Davies@bigfoot.com to send
|
||||
notifications on application launch
|
||||
* Source/NSWorkspace.m: Patch by Aled.Davies@bigfoot.com to send
|
||||
notifications on application launch.
|
||||
|
||||
Tue Oct 12 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSWorkspace.m: Added private notification center class to
|
||||
|
|
|
@ -148,7 +148,9 @@ NSApplication *NSApp = nil;
|
|||
|
||||
NSDebugLog(@"Begin of NSApplication -init\n");
|
||||
|
||||
app_is_active = YES;
|
||||
unhide_on_activation = YES;
|
||||
app_is_hidden = YES;
|
||||
app_is_active = NO;
|
||||
listener = [GSServicesManager newWithApplication: self];
|
||||
|
||||
main_menu = nil;
|
||||
|
@ -198,6 +200,8 @@ NSApplication *NSApp = nil;
|
|||
/* Register our listener to incoming services requests etc. */
|
||||
[listener registerAsServiceProvider];
|
||||
|
||||
[self activateIgnoringOtherApps: YES];
|
||||
|
||||
#ifndef STRICT_OPENSTEP
|
||||
/* Register self as observer to every window closing. */
|
||||
[nc addObserver: self selector: @selector(_windowWillClose:)
|
||||
|
@ -298,7 +302,6 @@ NSApplication *NSApp = nil;
|
|||
[nc postNotificationName: NSApplicationWillResignActiveNotification
|
||||
object: self];
|
||||
|
||||
unhide_on_activation = NO;
|
||||
app_is_active = NO;
|
||||
|
||||
[nc postNotificationName: NSApplicationDidResignActiveNotification
|
||||
|
@ -889,6 +892,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
|||
*/
|
||||
[self activateIgnoringOtherApps: YES];
|
||||
}
|
||||
unhide_on_activation = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
NSWorkspace.m
|
||||
|
||||
Description...
|
||||
|
@ -597,6 +597,7 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
|
|||
{
|
||||
NSString *port = [appName stringByDeletingPathExtension];
|
||||
id app = nil;
|
||||
NSDictionary *userinfo = nil;
|
||||
|
||||
/*
|
||||
* Try to contact a running application.
|
||||
|
@ -626,6 +627,16 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
|
|||
@"Continue", nil, nil);
|
||||
return NO;
|
||||
}
|
||||
|
||||
userinfo = [NSDictionary dictionaryWithObject: appName
|
||||
forKey: @"NSApplicationName"];
|
||||
|
||||
// App being launched, raise NSWorkspaceWillLaunchApplicationNotification
|
||||
[workspaceCenter
|
||||
postNotificationName: NSWorkspaceWillLaunchApplicationNotification
|
||||
object: self
|
||||
userInfo: userinfo];
|
||||
|
||||
args = [NSArray arrayWithObjects: @"-GSFilePath", fullPath, nil];
|
||||
if ([NSTask launchedTaskWithLaunchPath: path arguments: args] == nil)
|
||||
{
|
||||
|
@ -635,6 +646,12 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
|
|||
@"Continue", nil, nil);
|
||||
return NO;
|
||||
}
|
||||
|
||||
[workspaceCenter
|
||||
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
|
||||
object: self
|
||||
userInfo: userinfo];
|
||||
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
|
@ -935,12 +952,31 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
|||
autolaunch: (BOOL)autolaunch
|
||||
{
|
||||
NSString *path;
|
||||
NSDictionary *userinfo;
|
||||
|
||||
path = [self locateApplicationBinary: appName];
|
||||
|
||||
if (path == nil)
|
||||
return NO;
|
||||
|
||||
userinfo = [NSDictionary dictionaryWithObject: appName
|
||||
forKey: @"NSApplicationName"];
|
||||
|
||||
// App being launched, raise NSWorkspaceWillLaunchApplicationNotification
|
||||
[workspaceCenter
|
||||
postNotificationName: NSWorkspaceWillLaunchApplicationNotification
|
||||
object: self
|
||||
userInfo: userinfo];
|
||||
|
||||
if ([NSTask launchedTaskWithLaunchPath: path arguments: nil] == nil)
|
||||
return NO;
|
||||
|
||||
// App has been launched raise NSWorkspaceDidLaunchApplicationNotification
|
||||
[workspaceCenter
|
||||
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
|
||||
object: self
|
||||
userInfo: userinfo];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue