mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 16:21:56 +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
228e7133be
commit
8cad842435
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>
|
Tue Oct 12 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/NSWorkspace.m: Added private notification center class to
|
* Source/NSWorkspace.m: Added private notification center class to
|
||||||
|
|
|
@ -148,7 +148,9 @@ NSApplication *NSApp = nil;
|
||||||
|
|
||||||
NSDebugLog(@"Begin of NSApplication -init\n");
|
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];
|
listener = [GSServicesManager newWithApplication: self];
|
||||||
|
|
||||||
main_menu = nil;
|
main_menu = nil;
|
||||||
|
@ -198,6 +200,8 @@ NSApplication *NSApp = nil;
|
||||||
/* Register our listener to incoming services requests etc. */
|
/* Register our listener to incoming services requests etc. */
|
||||||
[listener registerAsServiceProvider];
|
[listener registerAsServiceProvider];
|
||||||
|
|
||||||
|
[self activateIgnoringOtherApps: YES];
|
||||||
|
|
||||||
#ifndef STRICT_OPENSTEP
|
#ifndef STRICT_OPENSTEP
|
||||||
/* Register self as observer to every window closing. */
|
/* Register self as observer to every window closing. */
|
||||||
[nc addObserver: self selector: @selector(_windowWillClose:)
|
[nc addObserver: self selector: @selector(_windowWillClose:)
|
||||||
|
@ -298,7 +302,6 @@ NSApplication *NSApp = nil;
|
||||||
[nc postNotificationName: NSApplicationWillResignActiveNotification
|
[nc postNotificationName: NSApplicationWillResignActiveNotification
|
||||||
object: self];
|
object: self];
|
||||||
|
|
||||||
unhide_on_activation = NO;
|
|
||||||
app_is_active = NO;
|
app_is_active = NO;
|
||||||
|
|
||||||
[nc postNotificationName: NSApplicationDidResignActiveNotification
|
[nc postNotificationName: NSApplicationDidResignActiveNotification
|
||||||
|
@ -889,6 +892,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
||||||
*/
|
*/
|
||||||
[self activateIgnoringOtherApps: YES];
|
[self activateIgnoringOtherApps: YES];
|
||||||
}
|
}
|
||||||
|
unhide_on_activation = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
NSWorkspace.m
|
NSWorkspace.m
|
||||||
|
|
||||||
Description...
|
Description...
|
||||||
|
@ -597,6 +597,7 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
|
||||||
{
|
{
|
||||||
NSString *port = [appName stringByDeletingPathExtension];
|
NSString *port = [appName stringByDeletingPathExtension];
|
||||||
id app = nil;
|
id app = nil;
|
||||||
|
NSDictionary *userinfo = nil;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to contact a running application.
|
* Try to contact a running application.
|
||||||
|
@ -626,6 +627,16 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
|
||||||
@"Continue", nil, nil);
|
@"Continue", nil, nil);
|
||||||
return NO;
|
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];
|
args = [NSArray arrayWithObjects: @"-GSFilePath", fullPath, nil];
|
||||||
if ([NSTask launchedTaskWithLaunchPath: path arguments: args] == nil)
|
if ([NSTask launchedTaskWithLaunchPath: path arguments: args] == nil)
|
||||||
{
|
{
|
||||||
|
@ -635,6 +646,12 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
|
||||||
@"Continue", nil, nil);
|
@"Continue", nil, nil);
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[workspaceCenter
|
||||||
|
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
|
||||||
|
object: self
|
||||||
|
userInfo: userinfo];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -935,12 +952,31 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
||||||
autolaunch: (BOOL)autolaunch
|
autolaunch: (BOOL)autolaunch
|
||||||
{
|
{
|
||||||
NSString *path;
|
NSString *path;
|
||||||
|
NSDictionary *userinfo;
|
||||||
|
|
||||||
path = [self locateApplicationBinary: appName];
|
path = [self locateApplicationBinary: appName];
|
||||||
|
|
||||||
if (path == nil)
|
if (path == nil)
|
||||||
return NO;
|
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)
|
if ([NSTask launchedTaskWithLaunchPath: path arguments: nil] == nil)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
|
// App has been launched raise NSWorkspaceDidLaunchApplicationNotification
|
||||||
|
[workspaceCenter
|
||||||
|
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
|
||||||
|
object: self
|
||||||
|
userInfo: userinfo];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue